class CVCircuit(QuantumCircuit): (source)
Constructor: CVCircuit(*regs, name, probe_measure)
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 |
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 |
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 |
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 |
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 |
Undocumented |
Method | get |
Return the qumode cutoff at the given index |
Method | get |
Return the qumode index for the given qubit. If not found, return -1. |
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. |
Instance Variable | _ancillas |
Undocumented |
Instance Variable | _calibrations |
Undocumented |
Instance Variable | _clbit |
Undocumented |
Instance Variable | _clbits |
Undocumented |
Instance Variable | _data |
Undocumented |
Instance Variable | _metadata |
Undocumented |
Instance Variable | _qubit |
Undocumented |
Instance Variable | _qubit |
Undocumented |
Instance Variable | _qubits |
Undocumented |
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. |
Raises | |
ValueError | If no QumodeRegister is provided. |
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 | Undocumented |
duration | Undocumented |
unit | Undocumented |
qubitQubit | QisKit control Qubit |
Returns | |
Instruction | QisKit instruction |
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 | Undocumented |
unit | Undocumented |
state 0 and 1 | |
respectively | |
qumode will be displaced by alpha and beta for qubit state 0 and 1 | |
Returns | |
Instruction | QisKit instruction |
Qubit dependent phase-space rotation gate (i.e., dispersive interaction).
Parameters | |
theta:real | phase |
qumode | Undocumented |
qubit | Undocumented |
duration | Undocumented |
unit | Undocumented |
qumodelist | list of qubits representing qumode |
qubitqubit | QisKit control qubit |
Returns | |
Instruction | QisKit instruction |
Qubit dependent phase-space rotation around sigma^x gate.
Parameters | |
theta:real | phase |
qumode | Undocumented |
qubit | Undocumented |
duration | Undocumented |
unit | Undocumented |
qumodelist | list of qubits representing qumode |
qubitqubit | QisKit control qubit |
Returns | |
Instruction | QisKit instruction |
Qubit dependent phase-space rotation around sigma^y gate.
Parameters | |
theta:real | phase |
qumode | Undocumented |
qubit | Undocumented |
duration | Undocumented |
unit | Undocumented |
qumodelist | list of qubits representing qumode |
qubitqubit | QisKit control qubit |
Returns | |
Instruction | QisKit instruction |
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 | Undocumented |
duration | Undocumented |
unit | Undocumented |
qubitQubit | QisKit control Qubit |
Returns | |
Instruction | QisKit instruction |
CV_delay. Implements an identity gate of the specified duration. This is particularly useful for the implementation of a noise pass.
Parameters | |
duration:real | duration of delay gate |
qumode:list | list of qubits representing qumode |
unit | Undocumented |
Returns | |
Instruction | QisKit instruction |
Echoed controlled displacement gate.
Parameters | |
theta:real | displacement |
qumode:list | list of qubits representing qumode |
qubit | Undocumented |
duration | Undocumented |
unit | Undocumented |
Returns | |
Instruction | QisKit instruction |
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 |
duration | Undocumented |
unit | Undocumented |
label:str | Undocumented |
Returns | |
Instruction | QisKit instruction |
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. |
Measure Qumodes and Qubits in qubit_qumode_list and map onto classical bits specified in cbit_list.
Parameters | |
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 | Undocumented |
unit | Undocumented |
Returns | |
Instruction | QisKit instruction |
Wrap the Qiskit QuantumCircuit Snapshot function, giving it a known label for later Wigner function plot generation
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 |
duration | Undocumented |
unit | Undocumented |
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