module documentation
Undocumented
Function | animate |
Animate the Wigner function at each step defined in the given CVCirctuit. |
Function | save |
Undocumented |
Function | __discretize |
Undocumented |
Function | __discretize |
Undocumented |
Function | __simulate |
Simulate Wigner function, preserving state between iterations |
Function | _animate |
Generate individual matplotlib frame in animation. |
Function | _animate |
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:CVCircuit | circuit 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. |
animationint , optional | Number of segments to split each gate into for animation. Defaults to 10. |
discretizefloat | Undocumented |
shots:int , optional | Number of simulation shots per frame. Defaults to 1. |
file:str , optional | File path to save (supported formats include MP4 with ffmpeg installed, animated GIF, and APNG). If None, return plot. Defaults to None. |
axesint , optional | Minimum axes plot value. Defaults to -6. |
axesint , optional | Maximum axes plot value. Defaults to 6. |
axesint , optional | Steps between axes ticks. Defaults to 200. |
processes:int , optional | Number of parallel Python processes to start. If None, perform serially in main process. Defaults to None. |
keepbool , optional | True 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. |
noiselist of Qiskit noise passes, optional | noise passes to apply |
sequentialbool , optional | boolean flag to animate subcircuits as one gate (False) or as sequential gates (True). Defautls to False. |
drawbool , optional | True if grid lines should be drawn on plot. Defaults to False. |
trace:bool , optional | True if qubits should be tracedfor each frame prior to calculating Wigner function. Defaults to True. |
bitrate:int | Undocumented |
Returns | |
[type] | [description] |
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