class CVCircuit(QuantumCircuit): (source)
Constructor: CVCircuit(*regs, name, probe_measure, force_parameterized_unitary_gate)
Extension of QisKit QuantumCircuit to add continuous variable (bosonic) gate support to simulations.
| Method | __init__ |
Initialize the registers (at least one must be QumodeRegister) and set the circuit name. |
| Method | add |
Add a qubit register to the circuit. |
| Method | cv |
Anti-Jaynes-Cummings gate |
| Method | cv |
Two-mode beam splitter gate. |
| Method | cv |
Controlled phase two-mode beam splitter |
| Method | cv |
Conditional displacement gate. |
| Method | cv |
SNAP (Selective Number-dependent Arbitrary Phase) gates for multiboson sampling. |
| Method | cv |
PNR (Photon number readout) TODO: Needs comments/explanation/citation! |
| Method | cv |
Qubit dependent phase-space rotation gate (i.e., dispersive interaction). |
| Method | cv |
Qubit dependent phase-space rotation around sigma^x gate. |
| Method | cv |
Qubit dependent phase-space rotation around sigma^y gate. |
| Method | cv |
General form of a controlled 'Schwinger' gate, containing both the controlled phase beamsplitter and pairs of controlled phase space rotations as special cases. |
| Method | cv |
Conditional squeezing gate. |
| Method | cv |
Conditional two-mode sum gate. |
| Method | cv |
Displacement gate. |
| Method | cv |
CV_delay. Implements an identity gate of the specified duration. This is particularly useful for the implementation of a noise pass. |
| Method | cv |
Echoed controlled displacement gate. |
| Method | cv |
Exponential SWAP gate. |
| Method | cv |
Converts matrix to gate. Note that if you choose to input some complex gate that would typically be physically implemented by multiple successive gate operations, PhotonLossNoisePass, simulate(discretize=True), and animate may not be applied in a way that is physical. |
| Method | cv |
Initialize qumode (or qumodes) to a particular state specified by params |
| Method | cv |
Jaynes-Cummings gate |
| Method | cv |
Measure Qumodes and Qubits in qubit_qumode_list and map onto classical bits specified in cbit_list. |
| Method | cv |
Phase space rotation gate. |
| Method | cv |
Rabi interaction gate |
| Method | cv |
SNAP (Selective Number-dependent Arbitrary Phase) gate. If no qubit is passed, then phases are applied to each qumode Fock state specified in theta and n (without explicit rotation of the qubit). If a qubit is passed, the phase will be multiplied by sigma_z-dependent geometric phase (akin to the implementation of the SNAP gate as described in Heeres et al, PRL (2015). |
| Method | cv |
Wrap the Qiskit QuantumCircuit Snapshot function, giving it a known label for later Wigner function plot generation |
| Method | cv |
Squeezing gate. |
| Method | cv |
Two-mode squeezing gate |
| Method | cv |
Three-mode squeezing gate |
| Method | cv |
Selective Qubit Rotation (SQR) gate |
| Method | cv |
Two-mode sum gate. |
| Method | get |
Return the qumode cutoff at the given index |
| Method | get |
Return the qumode index for the given qubit. If not found, raises ValueError |
| Method | get |
Return the number of qubits in the qumode register at the given index |
| Method | get |
Return the index of the given Qubit |
| Method | get |
Return the indices of the given Qubits |
| Method | measure |
Measure qubit in x using probe qubits |
| Method | measure |
Measure qubit in y using probe qubits |
| Method | measure |
Measure qubit in z using probe qubits |
| Method | merge |
Merge in properties of QisKit QuantumCircuit into this instance. |
| Method | save |
Save the simulator statevector using a qiskit class |
| Instance Variable | cregs |
Undocumented |
| Instance Variable | cv |
Undocumented |
| Instance Variable | ops |
Undocumented |
| Instance Variable | probe |
Undocumented |
| Instance Variable | probe |
Undocumented |
| Instance Variable | qmregs |
Undocumented |
| Instance Variable | qregs |
Undocumented |
| Property | cv |
All the CV gate names on the current circuit. These will be instances of ParameterizedUnitaryGate. |
| Property | qumode |
A qubit index list of the qubits representing the qumode registers on the circuit |
| Property | qumode |
All the qubits representing the qumode registers on the circuit |
| Property | qumode |
Same as qumode_qubit_indices but it groups qubits representing the same qumode together. Returns a nested list. |
| Method | _new |
Undocumented |
| Instance Variable | _ancillas |
Undocumented |
| Instance Variable | _calibrations |
Undocumented |
| Instance Variable | _clbit |
Undocumented |
| Instance Variable | _clbits |
Undocumented |
| Instance Variable | _data |
Undocumented |
| Instance Variable | _force |
Undocumented |
| Instance Variable | _has |
Undocumented |
| Instance Variable | _metadata |
Undocumented |
| Instance Variable | _qubit |
Undocumented |
| Instance Variable | _qubit |
Undocumented |
| Instance Variable | _qubits |
Undocumented |
str | None = None, probe_measure: bool = False, force_parameterized_unitary_gate: bool = True):
(source)
¶
Initialize the registers (at least one must be QumodeRegister) and set the circuit name.
| Parameters | |
| *regs | Undocumented |
name:str, optional | circuit name. Defaults to None. |
probebool, optional | automatically support measurement with probe qubits. Defaults to False. |
forcebool, optional | if set to False, improve performance by creating Qiskit UnitaryGate instead of bosonic-qiskit ParamaterizedUnitaryGate and skip transpilation in the util module's simulate() function. Note that bosonic-qiskit ParameterizedUnitaryGate are required for Qiskit parameterized circuits, circuits using photon loss noise passes, and cicruits animated with discretized gates. Defaults to True. |
| Raises | |
ValueError | If no QumodeRegister is provided. |
complex, qumode_a: Qumode, qumode_b: Qumode, qubit: Qubit, duration: int = 100, unit: str = 'ns') -> InstructionSet:
(source)
¶
Controlled phase two-mode beam splitter
| Parameters | |
theta:real or complex | phase |
qumodelist | list of qubits representing first qumode |
qumodelist | list of qubits representing second qumode |
qubit:Qubit | Undocumented |
duration:int | Undocumented |
unit:str | Undocumented |
qubitQubit | QisKit control Qubit |
| Returns | |
Instruction | QisKit instruction |
float, qumode: Qumode, qubit: Qubit, beta: float | None = None, duration: int = 100, unit: str = 'ns') -> InstructionSet:
(source)
¶
Conditional displacement gate.
| Parameters | |
theta:real | displacement |
qumode:list | list of qubits representing qumode |
qubit:Qubit | control qubit |
beta:real | By default is None, and qumode will be displaced by alpha and -alpha for qubit |
duration:int | Undocumented |
unit:str | Undocumented |
| state 0 and 1 | |
| respectively | |
| qumode will be displaced by alpha and beta for qubit state 0 and 1 | |
| Returns | |
Instruction | QisKit instruction |
float, qumode: Qumode, qubit: Qubit, duration: int = 100, unit: str = 'ns') -> InstructionSet:
(source)
¶
Qubit dependent phase-space rotation gate (i.e., dispersive interaction).
| Parameters | |
theta:real | phase |
qumode:Qumode | Undocumented |
qubit:Qubit | Undocumented |
duration:int | Undocumented |
unit:str | Undocumented |
qumodelist | list of qubits representing qumode |
qubitqubit | QisKit control qubit |
| Returns | |
Instruction | QisKit instruction |
Sequence[ float], qumode_a: Qumode, qumode_b: Qumode, qubit: Qubit, duration: int = 100, unit: str = 'ns') -> InstructionSet:
(source)
¶
General form of a controlled 'Schwinger' gate, containing both the controlled phase beamsplitter and pairs of controlled phase space rotations as special cases.
It has the form exp(-i*beta*(n1_hat.sigma)(n2_hat.S)), where ni_hat = sin(theta_i)*cos(phi_i) + sin(theta_i)*sin(phi_i) + cos(theta_i). sigma = [sigmax, sigmay, sigmaz] is the vector of Pauli operators, and S = [Sx, Sy, Sz] is a vector of Schwinger boson operators,
Sx = (a*bdag + adag*b)/2 Sy = (a*bdag - adag*b)/2i Sz = (bdag*b - adag*a)/2,
obeying the commutation relations [Sj, Sk] = i*epsilon_{ijk}*Sz, where epsilon_{ijk} is the Levi-Civita tensor.
| Parameters | |
params:real | [beta, theta_1, phi_1, theta_2, phi_2] |
qumodelist | list of qubits representing first qumode |
qumodelist | list of qubits representing second qumode |
qubit:Qubit | Undocumented |
duration:int | Undocumented |
unit:str | Undocumented |
qubitQubit | QisKit control Qubit |
| Returns | |
Instruction | QisKit instruction |
ArrayLike, qumodes: Qumode | Sequence[ Qumode] | QumodeRegister | None = None, qubits: Qubit | Sequence[ Qubit] | QuantumRegister | None = None, label: str = 'cv_gate_from_matrix'):
(source)
¶
Converts matrix to gate. Note that if you choose to input some complex gate that would typically be physically implemented by multiple successive gate operations, PhotonLossNoisePass, simulate(discretize=True), and animate may not be applied in a way that is physical.
| Parameters | |
matrix:np.array/nested list | Matrix for conversion into gate |
qumodes:QumodeRegister/list | Qumodes initialized by QumodeRegister |
qubits:QuantumRegister/list | Qubits initialized by QuantumRegister |
label:str | Undocumented |
| Returns | |
Instruction | QisKit instruction |
int | Sequence[ complex], qumodes: Qumode | Sequence[ Qumode]):
(source)
¶
Initialize qumode (or qumodes) to a particular state specified by params
| Parameters | |
params:list or int | If an int, all specified qumodes will be initialized to the Fock state with n=params. If a list, all specified qumodes will be initialized to a superposition of Fock states, with params[n] the complex amplitude of Fock state |n>. The length of params must be less than or equal to the cutoff. |
qumodes:list | list of qubits representing a single qumode, or list of multiple qumodes |
| Raises | |
ValueError | If the Fock state is greater than the cutoff. |
Qubit | Qumode | Sequence[ Qubit | Qumode] | QuantumRegister | QumodeRegister, cargs: Clbit | Sequence[ Clbit] | ClassicalRegister) -> InstructionSet:
(source)
¶
Measure Qumodes and Qubits in qubit_qumode_list and map onto classical bits specified in cbit_list.
| Parameters | |
qargs:Qubit | Qumode | Sequence[ | Undocumented |
cargs:Clbit | Sequence[ | Undocumented |
qubitList | List of individual Qubits and Qumodes (i.e., indexed elements of QubitRegisters and QumodeRegisters) |
cbitList | List of classical bits to map measurements onto. Note: Measurement of qumodes requires log(c) classical bits, where c is the cutoff. If len(cbit_list) is greater than the required number of classical bits, excess will be ignored. If len(cbit_list) is insufficient, an error will be thrown. |
| Returns | |
Instruction | QisKit measure instruction |
SNAP (Selective Number-dependent Arbitrary Phase) gate. If no qubit is passed, then phases are applied to each qumode Fock state specified in theta and n (without explicit rotation of the qubit). If a qubit is passed, the phase will be multiplied by sigma_z-dependent geometric phase (akin to the implementation of the SNAP gate as described in Heeres et al, PRL (2015).
| Parameters | |
theta:real or list[real] | phase |
n:integer or list[integer] | Fock state in which the mode should acquire the phase |
qumode:list | list of qubits representing qumode |
qubit:Qubit | control qubit. If no qubit is passed, the gate will implement for sigma^z = +1. |
duration:int | Undocumented |
unit:str | Undocumented |
| Returns | |
Instruction | QisKit instruction |
Wrap the Qiskit QuantumCircuit Snapshot function, giving it a known label for later Wigner function plot generation
complex, qumode_a: Qumode, qumode_b: Qumode, qumode_c: Qumode, duration: int = 100, unit: str = 'ns') -> InstructionSet:
(source)
¶
Three-mode squeezing gate
| Parameters | |
theta:real or complex | squeeze |
qumodelist | list of qubits representing first qumode |
qumodelist | list of qubits representing second qumode |
qumodelist | list of qubits representing third qumode |
duration:int | Undocumented |
unit:str | Undocumented |
| Returns | |
Instruction | QisKit instruction |
ArrayLike, phi: ArrayLike, n: ArrayLike, qumode: Qumode, qubit: Qubit, duration: int = 100, unit: str = 'ns') -> InstructionSet:
(source)
¶
Selective Qubit Rotation (SQR) gate
This gate applies a qubit rotation conditioned on the Fock state(s) of the oscillator. See eq. 234 of arXiv:2407.10381.
Measure qubit in x using probe qubits
| Parameters | |
qubit:Qubit | QisKit qubit to measure |
cbit:ClassicalBit | QisKit classical bit to measure into |
| Returns | |
Instruction | QisKit measure instruction |
Measure qubit in y using probe qubits
| Parameters | |
qubit:Qubit | QisKit qubit to measure |
cbit:ClassicalBit | QisKit classical bit to measure into |
| Returns | |
Instruction | QisKit measure instruction |
Measure qubit in z using probe qubits
| Parameters | |
qubit:Qubit | QisKit qubit to measure |
cbit:ClassicalBit | QisKit classical bit to measure into |
| Returns | |
Instruction | QisKit measure instruction |
Merge in properties of QisKit QuantumCircuit into this instance.
Useful if QisKit returned a new instance of QuantumCircuit after passing in this instance. Calling merge() can merge the two, keeping this instance.
See https://qiskit.org/documentation/_modules/qiskit/circuit/quantumcircuit.html#QuantumCircuit.copy
str = 'statevector', conditional: bool = False, pershot: bool = False):
(source)
¶
Save the simulator statevector using a qiskit class
Same as qumode_qubit_indices but it groups qubits representing the same qumode together. Returns a nested list.