Ops¶
Fock¶
FockState
¶
Bases: AbstractPureState
Fock state.
Source code in src/squint/ops/fock.py
FixedEnergyFockState
¶
Bases: AbstractPureState
Fixed energy Fock superposition.
Source code in src/squint/ops/fock.py
TwoModeWeakThermalState
¶
Bases: AbstractMixedState
Two-mode weak coherent source.
Source code in src/squint/ops/fock.py
TwoModeSqueezingGate
¶
Bases: AbstractGate
TwoModeSqueezingGate
Source code in src/squint/ops/fock.py
BeamSplitter
¶
Bases: AbstractGate
Beam splitter
Source code in src/squint/ops/fock.py
LinearOpticalUnitaryGate
¶
Bases: AbstractGate
Source code in src/squint/ops/fock.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
Phase
¶
Bases: AbstractGate
Phase gate.
Source code in src/squint/ops/fock.py
Discrete variable¶
DiscreteVariableState
¶
Bases: AbstractPureState
A pure quantum state for a discrete variable system.
\(\ket{\rho} \in \sum_{(a_i, \textbf{i}) \in n} a_i \ket{\textbf{i}}\)
Source code in src/squint/ops/dv.py
MaximallyMixedState
¶
Bases: AbstractMixedState
Source code in src/squint/ops/dv.py
XGate
¶
Bases: AbstractGate
The generalized shift operator, which when dim = 2
corresponds to the standard \(X\) gate.
\(U = \sum_{k=1}^d \ket{k} \bra{(k+1) \text{mod} d}\)
Source code in src/squint/ops/dv.py
ZGate
¶
Bases: AbstractGate
The generalized phase operator, which when dim = 2
corresponds to the standard \(Z\) gate.
\(U = \sum_{k=1}^d e^{2i \pi k /d} \ket{k}\bra{k}\)
Source code in src/squint/ops/dv.py
HGate
¶
Bases: AbstractGate
The generalized discrete Fourier operator, which when dim = 2
corresponds to the standard \(H\) gate.
\(U = \sum_{j,k=1}^d e^{2 i \pi j k / d} \ket{j}\bra{k}\)
Source code in src/squint/ops/dv.py
Conditional
¶
Bases: AbstractGate
The generalized conditional operator. If the gate \(U\) is applied conditional on the state, \(U = \sum_{k=1}^d \ket{k} \bra{k} \otimes U^k\)
Source code in src/squint/ops/dv.py
RXGate
¶
Bases: AbstractGate
The qubit RXGate gate
Source code in src/squint/ops/dv.py
RYGate
¶
Bases: AbstractGate
The qubit RYGate gate
Source code in src/squint/ops/dv.py
Noise¶
ErasureChannel
¶
Bases: AbstractErasureChannel
Erasure channel/photon loss.
Source code in src/squint/ops/noise.py
BitFlipChannel
¶
Bases: AbstractKrausChannel
Qubit bit flip channel.
Source code in src/squint/ops/noise.py
PhaseFlipChannel
¶
Bases: AbstractKrausChannel
Qubit phase flip channel.
Source code in src/squint/ops/noise.py
DepolarizingChannel
¶
Bases: AbstractKrausChannel
Qubit depolarizing channel.
Source code in src/squint/ops/noise.py
Blocks¶
brickwork(wires: Sequence[WiresTypes], depth: int, LocalGates: Union[Type[AbstractGate], Sequence[Type[AbstractGate]]], CouplingGate: Type[AbstractGate], periodic: bool = False) -> Block
¶
Create a brickwork block with the specified local and coupling gates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wires
|
Sequence[WiresTypes]
|
The wires to apply the gates to. |
required |
depth
|
int
|
The depth of the brickwork block. |
required |
LocalGates
|
Union[Type[AbstractGate], Sequence[Type[AbstractGate]]]
|
The local gates to apply to each wire. |
required |
CouplingGate
|
Type[AbstractGate]
|
The coupling gate to apply to pairs of wires. |
required |
periodic
|
bool
|
Whether to use periodic boundary conditions. |
False
|
Returns: Block: A block containing the specified brickwork structure.
Source code in src/squint/blocks.py
brickwork_type(wires: Sequence[WiresTypes], depth: int, ansatz: Literal[hea, rxx, rzz], periodic: bool = False)
¶
Create a brickwork block with the specified ansatz type. Ansatz can be one of 'hea', 'rxx', or 'rzz'. - 'hea' uses RX and RY gates for one-qubit gates and CZ for two-qubit gates. - 'rxx' uses RX and RY gates for one-qubit gates and RXX for two-qubit gates. - 'rzz' uses RZ gates for one-qubit gates and RZZ for two-qubit gates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wires
|
Sequence[WiresTypes]
|
The wires to apply the gates to. |
required |
depth
|
int
|
The depth of the brickwork block. |
required |
ansatz
|
Literal[hea, rxx, rzz]
|
The type of ansatz to use. |
required |
periodic
|
bool
|
Whether to use periodic boundary conditions. |
False
|
Returns:
Name | Type | Description |
---|---|---|
Block |
A block containing the specified brickwork ansatz. |