spheres.visualization.schwinger_spheres.SchwingerSpheres¶
-
class
spheres.visualization.schwinger_spheres.
SchwingerSpheres
(state=None, scene=None, pos=<0, 0, 0>, show_plane=False)[source]¶ Bases:
object
Visualization for two oscillators as a tower of spin-j states. If show_plane=True, displays a representation of the 2D oscillator position states.
-
__init__
(state=None, scene=None, pos=<0, 0, 0>, show_plane=False)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
([state, scene, pos, show_plane])Initialize self.
destroy
()Destroys the Schwinger spheres.
evolve
([H, dt, T])Evolves the state, updating the visual in real time.
lower_spin
(spin)Lowers a spin-j state.
measure
(direction)Applies a projective measurement (with random outcomes).
raise_spin
(spin[, replace])Raises a spin-j state.
random
()Load in a random state.
- returns
H – Random Hamiltonian of the right dimensions.
refresh
()vacuum
()Load in the vacuum state.
-
evolve
(H=None, dt=0.05, T=6.283185307179586)[source]¶ Evolves the state, updating the visual in real time.
- Parameters
H (qt.Qobj) – Hamiltonian. If provided with a first quantized Hamiltonian, automatically second quantizes.
dt (float) – Time step.
T (float) – Time interval.
-
measure
(direction)[source]¶ Applies a projective measurement (with random outcomes).
- Parameters
direction (str) – “x”, “y”, “z”, or “q” (2D position).
-
raise_spin
(spin, replace=False)[source]¶ Raises a spin-j state.
- Parameters
spin (qt.Qobj) –
replace (bool) – If True, raises the spin state from the vacuum.
-