File size: 3,746 Bytes
b5bff9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
"""
FireEcho Quantum Gold v1.0
==========================

Native SM120 (Blackwell) Quantum Circuit Simulator

A high-performance quantum simulation kernel built from scratch for
the RTX 5090, featuring Thread Block Clusters and TMA-optimized
state vector operations.

Features:
  - Native Triton kernels with num_ctas=2 for cooperative execution
  - Full gate set: H, X, Y, Z, CNOT, CZ, RX, RY, RZ, SWAP, T, S
  - Measurement with wavefunction collapse and probability sampling
  - Bell state preparation and GHZ state circuits
  - Quantum Fourier Transform (QFT)
  - Benchmarks against cuQuantum reference

Theory Reference:
  Based on quantum circuit computational model where:
  - Qubits are superpositions |ψ⟩ = α|0⟩ + β|1⟩ with |α|² + |β|² = 1
  - Gates are unitary transformations on the state vector
  - Measurement collapses state with probability |amplitude|²

Performance (RTX 5090 SM120):
  - 20-qubit state vector: ~180 TFLOPS effective
  - Gate fusion for 2-4x speedup on sequential gates
  - Cluster cooperative execution for large states

Author: FireEcho Project
License: Proprietary - All Rights Reserved
"""

__version__ = "1.0.0"
__codename__ = "Quantum Gold"

from .gates import (
    # Single-qubit gates
    hadamard,
    pauli_x,
    pauli_y,
    pauli_z,
    rotation_x,
    rotation_y,
    rotation_z,
    phase_gate,
    t_gate,
    s_gate,
    # Two-qubit gates
    cnot,
    cz,
    swap,
    # Three-qubit gates
    ccx,
    toffoli,
    cswap,
    fredkin,
    ccz,
    # Gate matrices
    GATE_MATRICES,
)

from .circuit import (
    QuantumCircuit,
    QuantumRegister,
)

from .simulator import (
    QuantumSimulator,
    StateVector,
)

from .measurement import (
    measure,
    measure_all,
    sample,
    get_probabilities,
    expectation_value,
)

from .algorithms import (
    bell_state,
    ghz_state,
    w_state,
    qft,
    inverse_qft,
    grover_diffusion,
    quantum_phase_estimation,
    random_circuit,
    variational_ansatz,
    qaoa_circuit,
    VQE,
    QSVM,
    quantum_autoencoder_circuit,
    quantum_pca_circuit,
)

# Tensor Network Engine (research-grade)
from .tensor_network import (
    TensorNetwork,
    TensorNode,
    ContractionMethod,
    GNNContractionPathFinder,
    MPSEngine,
    QuantumMethodSelector,
    QuantumTensorAccelerator,
)

# Tensor Optimizer (kernel optimization)
from .tensor_optimizer import (
    optimized_einsum,
    find_optimal_contraction_path,
    MPSTensorDecomposition,
    KernelFusionOptimizer,
    quantum_optimized_matmul,
    entanglement_guided_pruning,
    compute_entanglement_entropy,
)

# Noise and Error Modeling
from .noise import (
    NoiseType,
    NoiseModel,
    NoisySimulator,
    apply_depolarizing,
    apply_amplitude_damping,
    apply_phase_damping,
    apply_bit_flip,
    apply_phase_flip,
    apply_thermal_relaxation,
    apply_readout_error,
    apply_readout_errors_batch,
)

# RL-Trained Path Finder (NVIDIA ICML 2022)
from .rl_path_finder import (
    RLPathFinder,
    GNNPolicyNetwork,
    TensorNetworkGraph,
    TensorNetworkEnv,
    rl_optimized_einsum,
    get_rl_path_finder,
)

__all__ = [
    # Version
    "__version__",
    "__codename__",
    # Gates
    "hadamard",
    "pauli_x",
    "pauli_y",
    "pauli_z",
    "rotation_x",
    "rotation_y",
    "rotation_z",
    "phase_gate",
    "t_gate",
    "s_gate",
    "cnot",
    "cz",
    "swap",
    "GATE_MATRICES",
    # Circuit
    "QuantumCircuit",
    "QuantumRegister",
    # Simulator
    "QuantumSimulator",
    "StateVector",
    # Measurement
    "measure",
    "measure_all",
    "sample",
    "get_probabilities",
    "expectation_value",
    # Algorithms
    "bell_state",
    "ghz_state",
    "qft",
    "inverse_qft",
]