module documentation
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. |
Function | _add |
Add a matplotlib contourf plot with color levels based on min/max values in z. |
Function | _wigner |
Undocumented |
def plot(data, axes_min:
int
= -6, axes_max: int
= 6, axes_steps: int
= 200, file: str
= None, num_colors: int
= 100, draw_grid: bool
= False, dpi=100):
(source)
¶
Contour plot the given data array
def plot_wigner(circuit: 2), method:
CVCircuit
, state_vector: Statevector
, trace: bool
= True, file: str
= None, axes_min: int
= -6, axes_max: int
= 6, axes_steps: int
= 200, num_colors: int
= 100, draw_grid: bool
= False, dpi: int
= 100, g=sqrt(str
= 'clenshaw'):
(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 |
g | Undocumented |
method:str | Undocumented |
def plot_wigner_projection(circuit: 2), method:
CVCircuit
, qubit, file: str
= None, draw_grid: bool
= False, g=sqrt(str
= 'clenshaw'):
(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. |
g | Undocumented |
method:str | Undocumented |
def plot_wigner_snapshot(circuit: 2), method:
CVCircuit
, result: Result
, folder: Path
= None, trace: bool
= True, axes_min: int
= -6, axes_max: int
= 6, axes_steps: int
= 200, num_colors: int
= 100, g=sqrt(str
= 'clenshaw'):
(source)
¶
Undocumented
def simulate_wigner(circuit: 2), method:
CVCircuit
, xvec: np.ndarray
, shots: int
, noise_passes=None, conditional: bool
= True, trace: bool
= False, g=sqrt(str
= 'clenshaw'):
(source)
¶
Simulate the circuit, optionally partial trace the results, and calculate the Wigner function.
def simulate_wigner_multiple_statevectors(circuit: 2), method:
CVCircuit
, xvec: np.ndarray
, shots: int
, statevector_label: str
, num_statevectors: int
, noise_passes=None, trace: bool
= False, g=sqrt(str
= 'clenshaw'):
(source)
¶
Simulate the circuit, optionally partial trace the results, and calculate the Wigner function on each statevector starting with the given label.
def wigner(state, axes_min: 2), method:
int
= -6, axes_max: int
= 6, axes_steps: int
= 200, g=sqrt(str
= '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 | Undocumented |
method:str | 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 |
def wigner_mle(states, axes_min: 2), method:
int
= -6, axes_max: int
= 6, axes_steps: int
= 200, g=sqrt(str
= '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 | Undocumented |
method:str | 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 |