module documentation
Undocumented
Function | discretize |
Discretize gates into a circuit into segments where each segment ends an indiviudal circuit. Useful for incrementally applying noise or animating the circuit. |
Function | discretize |
Discretize gates into a circuit into segments within a single output circuit. Useful for incrementally applying noise or animating the circuit. |
Function | __discretize |
Split Qiskit Instruction into multiple segments |
Function | __discretize |
Split ParameterizedUnitaryGate into multiple segments |
Function | __discretize |
Create a list of circuits where the entire subcircuit is converted into segments (vs a single instruction). |
Function | __to |
Split the instruction into segments_per_gate segments |
def discretize_circuits(circuit:
CVCircuit
, segments_per_gate: int
= 10, keep_state: bool
= True, qubit: qiskit.circuit.quantumcircuit.QubitSpecifier
= None, cbit: qiskit.circuit.quantumcircuit.QubitSpecifier
= None, sequential_subcircuit: bool
= False):
(source)
¶
Discretize gates into a circuit into segments where each segment ends an indiviudal circuit. Useful for incrementally applying noise or animating the circuit.
Parameters | |
circuit:CVCircuit | circuit to simulate and plot |
segmentsint , optional | Number of segments to split each gate into. Defaults to 10. |
keepbool , optional | True if each gate segments builds on the previous gegment's state vector. False if each segment starts over from the beginning of the circuit. If True, it requires sequential simulation of each segment. |
qubit:[QubitSpecifier] | Qubit to measure, if performing Hadamard measure for use with cat states. Defaults to None. |
cbit:[QubitSpecifier] | Classical bit to measure into, if performing Hadamard measure for use with cat states. Defaults to None. |
sequentialbool , optional | boolean flag to animate subcircuits as one gate (False) or as sequential gates (True). Defautls to False. |
Returns | |
[list] | List of discretized Qiskit circuit |
def discretize_single_circuit(circuit:
CVCircuit
, segments_per_gate: int
= 10, epsilon: float
= None, sequential_subcircuit: bool
= False, statevector_per_segment: bool
= False, statevector_label: str
= 'segment_', noise_passes=None):
(source)
¶
Discretize gates into a circuit into segments within a single output circuit. Useful for incrementally applying noise or animating the circuit.
Parameters | |
circuit:CVCircuit | circuit to simulate and plot |
segmentsint , optional | Number of segments to split each gate into. Defaults to 10. |
epsilon:float , optional | float value used to discretize, must specify along with kappa |
sequentialbool , optional | boolean flag to animate subcircuits as one gate (False) or as sequential gates (True). Defaults to False. |
statevectorbool , optional | boolean flag to save a statevector per gate segment. True will call Qiskit save_statevector after each segment is simulated, creating statevectors labeled "segment_*" that can used after simulation. Defaults to False. |
statevectorstr , optional | String prefix to use for the statevector saved after each segment |
noiselist of Qiskit noise passes, optional | noise passes to apply |
kappa:float , optional | float phton loss rate to determine discretization sice, must specify along with epsilon |
Returns | |
discretized Qiskit circuit |
def __discretize_instruction(inst:
qiskit.circuit.instruction.Instruction
, segments_per_gate: int
, keep_state: bool
):
(source)
¶
Split Qiskit Instruction into multiple segments
def __discretize_parameterized(inst:
qiskit.circuit.instruction.Instruction
, segments_per_gate: int
, keep_state: bool
, discretized_param_indices: list
= []):
(source)
¶
Split ParameterizedUnitaryGate into multiple segments