Undocumented
| Function | plot |
Contour plot the given data array |
| Function | plot |
Produce a Matplotlib figure for the Wigner function on the given state vector. |
| Function | plot |
Plot the projection onto 0, 1, +, - for the given circuit. |
| Function | plot |
Undocumented |
| Function | simulate |
Simulate the circuit, optionally partial trace the results, and calculate the Wigner function |
| Function | simulate |
Simulate the circuit, optionally partial trace the results, and calculate the Wigner function on each statevector starting with the given label. |
| Function | wigner |
Calculate the Wigner function on the given state vector. |
| Function | wigner |
Find the maximum likelihood estimation for the given state vectors and calculate the Wigner function on the result. |
| Type Alias | |
Undocumented |
| Type Alias | |
Undocumented |
| Function | _add |
Add a matplotlib contourf plot with color levels based on min/max values in z. |
| Function | _wigner |
Undocumented |
int = -6, axes_max: int = 6, axes_steps: int = 200, file: str | Path | None = None, num_colors: int = 100, draw_grid: bool = False, dpi: int = 100):
(source)
¶
Contour plot the given data array
CVCircuit, state_vector: Statevector, trace: bool = True, file: str | Path | None = None, axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, num_colors: int = 100, draw_grid: bool = False, dpi: int = 100, **wigner_kwargs):
(source)
¶
Produce a Matplotlib figure for the Wigner function on the given state vector.
Optionally perform partial trace.
| Parameters | |
circuit:CVCircuit | circuit with results to trace (to find Qubit index) |
stateStatevector | simulation results to trace over and plot |
trace:bool, optional | True if qubits should be traced. Defaults to True. |
file:str, optional | File path to save plot. 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. |
numint, optional | Number of color gradients in legend. Defaults to 100. |
drawbool, optional | True if grid lines should be drawn on plot. Defaults to False. |
dpi:int | Undocumented |
| **wigner | Undocumented |
CVCircuit, qubit: Qubit, file: str | Path | None = None, draw_grid: bool = False, **wigner_kwargs):
(source)
¶
Plot the projection onto 0, 1, +, - for the given circuit.
This is limited to CVCircuit with only one qubit, also provided as a parameter.
| Parameters | |
circuit:CVCircuit | circuit to simulate and plot |
qubit:Qubit | qubit to measure |
file:str, optional | File path to save file, if None return plot. Defaults to None. |
drawbool, optional | True if gridlines should be drawn on plots. Defaults to False. |
| **wigner | Undocumented |
CVCircuit, result: Result, folder: str | Path | None = None, trace: bool = True, axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, num_colors: int = 100, **wigner_kwargs):
(source)
¶
Undocumented
CVCircuit, xvec: np.ndarray, shots: int, noise_passes: NoisePassLike | None = None, conditional_state: str | None = None, trace: bool = False, method: WignerMethods = 'clenshaw', g: float = np.sqrt(tuple[ WignerResult, Statevector]:
(source)
¶
Simulate the circuit, optionally partial trace the results, and calculate the Wigner function
| Parameters | |
circuit:CVCircuit | The circuit to simulate |
xvec:np.ndarray | The grid points to evaluate on. This will also be used to define the grid in the y direction |
shots:int | The number of shots to execute |
noiseNoisePassLike | None | Optional noise passes to apply to the simulation |
conditionalstr | None | An optional state to select |
trace:bool | Whether or not to trace out all qubits, leaving the qumodes |
method:WignerMethods | The method used to calculate the wigner function. |
g:float | Undocumented |
| Returns | |
tuple[ | A tuple containing the wigner function and the statevector |
CVCircuit, xvec: ArrayLike, shots: int, statevector_label: str, num_statevectors: int, noise_passes: NoisePassLike | None = None, trace: bool = False, g: float = np.sqrt(WignerMethods = 'clenshaw') -> list[ WignerResult]:
(source)
¶
Simulate the circuit, optionally partial trace the results, and calculate the Wigner function on each statevector starting with the given label.
ArrayLike | Statevector | DensityMatrix, axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, g: float = np.sqrt(WignerMethods = 'clenshaw'):
(source)
¶
Calculate the Wigner function on the given state vector.
| Parameters | |
state:array-like | state vector to calculate Wigner function |
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. |
g:float | Undocumented |
method:WignerMethods | Undocumented |
cutoff:int | cutoff used during simulation |
hbar:int, optional | hbar value to use in Wigner function calculation. Defaults to 2. |
| Returns | |
array-like | Results of Wigner function calculation |
Sequence[ Statevector], axes_min: int = -6, axes_max: int = 6, axes_steps: int = 200, g: float = np.sqrt(WignerMethods = 'clenshaw'):
(source)
¶
Find the maximum likelihood estimation for the given state vectors and calculate the Wigner function on the result.
| Parameters | |
states:array-like of array-like | state vectors to calculate MLE and Wigner function |
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. |
g:float | Undocumented |
method:WignerMethods | Undocumented |
cutoff:int | cutoff used during simulation |
hbar:int, optional | hbar value to use in Wigner function calculation. Defaults to 2. |
| Returns | |
array-like | Results of Wigner function calculation |
Axes, fig: Figure, title: str, x: Sequence[ int | float], y: Sequence[ int | float], z: Sequence[ int | float], draw_grid: bool = False):
(source)
¶
Add a matplotlib contourf plot with color levels based on min/max values in z.
DensityMatrix, xvec: ArrayLike, yvec: ArrayLike | None = None, g: float = np.sqrt(WignerMethods = 'clenshaw') -> WignerResult:
(source)
¶
Undocumented