module documentation

Undocumented

Function discretize_circuits 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_single_circuit Discretize gates into a circuit into segments within a single output circuit. Useful for incrementally applying noise or animating the circuit.
Function __discretize_instruction Split Qiskit Instruction into multiple segments
Function __discretize_parameterized Split ParameterizedUnitaryGate into multiple segments
Function __discretize_subcircuit Create a list of circuits where the entire subcircuit is converted into segments (vs a single instruction).
Function __to_segments 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:CVCircuitcircuit to simulate and plot
segments_per_gate:int, optionalNumber of segments to split each gate into. Defaults to 10.
keep_state:bool, optionalTrue 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.
sequential_subcircuit:bool, optionalboolean 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:CVCircuitcircuit to simulate and plot
segments_per_gate:int, optionalNumber of segments to split each gate into. Defaults to 10.
epsilon:float, optionalfloat value used to discretize, must specify along with kappa
sequential_subcircuit:bool, optionalboolean flag to animate subcircuits as one gate (False) or as sequential gates (True). Defaults to False.
statevector_per_segment:bool, optionalboolean 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.
statevector_label:str, optionalString prefix to use for the statevector saved after each segment
noise_passes:list of Qiskit noise passes, optionalnoise passes to apply
kappa:float, optionalfloat 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

def __discretize_subcircuit(subcircuit: qiskit.QuantumCircuit, segments_per_gate: int, keep_state: bool, sequential_subcircuit: bool): (source)

Create a list of circuits where the entire subcircuit is converted into segments (vs a single instruction).

def __to_segments(inst: qiskit.circuit.instruction.Instruction, segments_per_gate: int, keep_state: bool, sequential_subcircuit: bool): (source)

Split the instruction into segments_per_gate segments