qit.plot.state_trajectory¶
- qit.plot.state_trajectory(traj, reset=True, ax=None, color='b', marker='')¶
Plot a state trajectory in the correlation representation.
For a single-qubit system, plots the trajectory in the Bloch sphere.
For a two-qubit system, plots the reduced single-qubit states (in Bloch spheres), as well as the interqubit correlations.
traj can be obtained e.g. by using one of the continuous-time state propagation functions and feeding the results to
state.bloch_vector
.- Parameters
traj (list[array], array) – generalized Bloch vector of the quantum state, or a list of them representing a trajectory
reset (bool) – if False, adds another trajectory to the axes without erasing .
ax (Axes) – axes to plot in, or None in which case a new figure is created
- Returns
axes containing the plot
- Return type
Axes
Example 1: Trajectory of the state s under the Hamiltonian H:
out = s.propagate(H, t, lambda s, H: s.bloch_vector()) state_trajectory(out)
Example 2: Just a single state s:
state_trajectory(s.bloch_vector())