module documentation

Undocumented

Function animate_wigner Animate the Wigner function at each step defined in the given CVCirctuit.
Function save_animation Undocumented
Function __discretize_wigner_with_measure Undocumented
Function __discretize_wigner_without_measure Undocumented
Function __simulate_wigner_with_state Simulate Wigner function, preserving state between iterations
Function _animate Generate individual matplotlib frame in animation.
Function _animate_init Undocumented
def animate_wigner(circuit: CVCircuit, qubit: qiskit.circuit.quantumcircuit.QubitSpecifier = None, cbit: qiskit.circuit.quantumcircuit.ClbitSpecifier = None, animation_segments: int = 10, discretize_epsilon: float = None, shots: int = 1, file: str = None, axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, processes: int = None, keep_state: bool = True, noise_passes=None, sequential_subcircuit: bool = False, draw_grid: bool = False, trace: bool = True, bitrate: int = -1): (source)

Animate the Wigner function at each step defined in the given CVCirctuit.

This assumes the CVCircuit was simulated with an animation_segments > 0 to act as the frames of the generated movie.

The ffmpeg binary must be on your system PATH in order to execute this function. See https://ffmpeg.org/download.html to download and install on your system.

Parameters
circuit:CVCircuitcircuit to simulate and plot
qubit:[type]Qubit to measure, if performing Hadamard measure for use with cat states. Defaults to None.
cbit:[type]Classical bit to measure into, if performing Hadamard measure for use with cat states. Defaults to None.
animation_segments:int, optionalNumber of segments to split each gate into for animation. Defaults to 10.
discretize_epsilon:floatUndocumented
shots:int, optionalNumber of simulation shots per frame. Defaults to 1.
file:str, optionalFile path to save (supported formats include MP4 with ffmpeg installed, animated GIF, and APNG). If None, return plot. Defaults to None.
axes_min:int, optionalMinimum axes plot value. Defaults to -6.
axes_max:int, optionalMaximum axes plot value. Defaults to 6.
axes_steps:int, optionalSteps between axes ticks. Defaults to 200.
processes:int, optionalNumber of parallel Python processes to start. If None, perform serially in main process. Defaults to None.
keep_state:bool, optionalTrue if each frame builds on the previous frame's state vector. False if each frame starts over from the beginning of the circuit. If True, it requires sequential simulation of each frame.
noise_passes:list of Qiskit noise passes, optionalnoise passes to apply
sequential_subcircuit:bool, optionalboolean flag to animate subcircuits as one gate (False) or as sequential gates (True). Defautls to False.
draw_grid:bool, optionalTrue if grid lines should be drawn on plot. Defaults to False.
trace:bool, optionalTrue if qubits should be tracedfor each frame prior to calculating Wigner function. Defaults to True.
bitrate:intUndocumented
Returns
[type][description]
def save_animation(anim: matplotlib.animation.FuncAnimation, file: str, bitrate: int): (source)

Undocumented

def __discretize_wigner_with_measure(circuit: CVCircuit, qubit: qiskit.circuit.quantumcircuit.QubitSpecifier = None, cbit: qiskit.circuit.quantumcircuit.ClbitSpecifier = None, animation_segments: int = 10, shots: int = 1, axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, processes: int = None, keep_state: bool = True, noise_passes=None, sequential_subcircuit: bool = False, trace: bool = True): (source)

Undocumented

def __discretize_wigner_without_measure(circuit: CVCircuit, animation_segments: int = 10, discretize_epsilon: float = None, shots: int = 1, axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, noise_passes=None, sequential_subcircuit: bool = False, trace: bool = True): (source)

Undocumented

def __simulate_wigner_with_state(circuits, qubit, cbit, xvec, shots, noise_passes, trace): (source)

Simulate Wigner function, preserving state between iterations

def _animate(frame, *fargs): (source)

Generate individual matplotlib frame in animation.

def _animate_init(): (source)

Undocumented