This doesn't really answer the question as it's not an online simulator. It might still be relevant though as it is a way to produce this sort of gifs if one has access to the software.
It is relatively easy to do this sort of things using Wolfram Mathematica.
As a quick and dirty example, if we just define a couple of relevant helper functions:
pauliX = PauliMatrix[1];
pauliY = PauliMatrix[2];
pauliZ = PauliMatrix[3];
ClearAll@decomposeInPauliBasis;
decomposeInPauliBasis[matrix_?MatrixQ] := {
Tr[matrix.pauliX], Tr[matrix.pauliY], Tr[matrix.pauliZ]
}/2;
decomposeInPauliBasis[vec_?VectorQ] := Re@{
Dot[Conjugate@vec, pauliX, vec], Dot[Conjugate@vec, pauliY, vec],
Dot[Conjugate@vec, pauliZ, vec]
};
ClearAll[simulateStateEvolution, smallestEigenvectors];
smallestEigenvectors[matrix_, howmany_Integer] := With[
{nn = Norm@Flatten@matrix},
Eigenvalues[matrix - nn IdentityMatrix[Dimensions@matrix],
howmany] + nn
];
simulateStateEvolution[H : (_Symbol | _Function | _CompiledFunction),
time_: 1., initialState_: None] := Module[{t},
Module[{\[DiamondSuit]initialState, \[DiamondSuit]H},
If[initialState === None,
\[DiamondSuit]initialState =
First@smallestEigenvectors[H[0], 1],
\[DiamondSuit]initialState = initialState
];
(* protect from symbolic evaluation *)
\[DiamondSuit]H[
t_?NumericQ] := H[t];
NDSolveValue[{
\[Psi][0] == \[DiamondSuit]initialState,
\[Psi]'[t] == -I \[DiamondSuit]H[t].\[Psi][t]
}, \[Psi], {t, 0, time}
][time]
]
];
we can then visualise the evolution in the Bloch sphere with
hamiltonian[t_] := pauliZ + 2 pauliX;
initialState = {1, 0};
With[{points = Table[
decomposeInPauliBasis@
simulateStateEvolution[hamiltonian, t, initialState],
{t, 0, 1, 0.01}
]},
Graphics3D[{
{Orange, [email protected], Sphere[{0, 0, 0}, 1]},
{Red, [email protected], Point@points[[1]]},
{Blue, [email protected], Point@points[[-1]]},
Dashed, [email protected], Arrow@points
}, Axes -> True, AxesOrigin -> {0, 0, 0}, AxesStyle -> Black,
Ticks -> None, Boxed -> False]
]
which gives
We can also use a time-dependent Hamiltonian, for example:
hamiltonian[t_] := pauliZ + t pauliX;
initialState = {1, 0};
With[{points = Table[
decomposeInPauliBasis@
simulateStateEvolution[hamiltonian, t, initialState],
{t, 0, 4, 0.01}
]},
Graphics3D[{
{Orange, [email protected], Sphere[{0, 0, 0}, 1]},
{Red, [email protected], Point@points[[1]]},
{Blue, [email protected], Point@points[[-1]]},
Dashed, [email protected], Arrow@points
}, Axes -> True, AxesOrigin -> {0, 0, 0}, AxesStyle -> Black,
Ticks -> None, Boxed -> False]
]
If you want something a bit more fancy, you can take the code I used in this answer to draw a better looking Bloch sphere, which would give something like the following:
Finally, if you want some animation, you can try something like the following (where I'm also adding the green line to denote the instantaneous eigenvector of the Hamiltonian):
hamiltonian[t_] := pauliZ + t pauliX;
initialState = {1, 0};
timesList = Range[0, 4, 0.01];
With[{points = Table[
decomposeInPauliBasis@
simulateStateEvolution[hamiltonian, t, initialState],
{t, timesList}
]},
Animate[
Graphics3D[{
{Orange, [email protected], Sphere[{0, 0, 0}, 1]},
{Red, [email protected], Point@points[[1]]},
{Purple, [email protected], Point@points[[idx]]},
{Darker@Green, [email protected],
InfiniteLine@{-#, #} &@
decomposeInPauliBasis@
First@Eigenvectors@hamiltonian@timesList[[idx]]},
{Dashed, [email protected], Tube@points[[;; idx]]}
}, Axes -> True, AxesOrigin -> {0, 0, 0}, AxesStyle -> Black,
Ticks -> None, Boxed -> False],
{idx, 1, Length@points, 1}
]
]
(quality and smoothness can definitely be improved here)