Basically I need the top color to remain the top color and the bottom color to remain the bottom color in an effort to properly reflect the avioded crossing taking place. Here is my code.
data = {};
Eg1 = {};
Eg2 = {};
For[\[CapitalDelta] = -10, \[CapitalDelta] <=
10, \[CapitalDelta] = \[CapitalDelta] + .1,
\[HBar] = 1.0;
u = 1.0;
(*Constants to allow numerical analysis*)
H = ( {
{0, u},
{u, \[CapitalDelta]}
} );
(*Hamiltonian defined*)
\[Psi] = ( {
{1},
{0}
} );
(*Intial state*)
eval = Eigenvalues [H];
AppendTo[Eg1, {\[CapitalDelta], eval[[1]]}];
AppendTo[Eg2, {\[CapitalDelta], eval[[2]]}];
(*Representing eigenvalues of the hamiltonian*)
S = Transpose[Normalize /@ Eigenvectors[H]];
(*This represents S hat,
a matrix consisting of the eigenvectors in order*)
Sd = ConjugateTranspose[S];
(*This represents S hat dagger,
a matrix consisting of the Hermitian conjugate or conjugate \
transpose of S hat*)
U[t_] := S. ( {
{E^(-I eval[[1]] t/\[HBar]), 0},
{0, E^(-I eval[[2]] t/\[HBar])}
} ).Sd;
(*This represents U(t), the time evolution operator,
a matrix operator composed of S hat,
e raised to \[CapitalLambda] hat (a matrix consisting of e to the \
(-i)(\[CapitalLambda] hat)(t/\[HBar])) where \[CapitalLambda] hat is \
matrix consisting of the eigenvalues along the diagonal in order with \
zeros elsewhere), and S hat dagger.
U(t) can be multiplied by \[Psi](0) to obtain \[Psi](t)*)
temp = {};
(*This will end up containing all results after the for loop \
iterations*)
For[t = 0, t <= 10, t = t + .01,
\[Psi]t = U[t].\[Psi];
(* This represents \[Psi]t,
the product of the time evolution operator and the initial state \
which we use to operate on an initial quantum mechanical system to \
find the state at a later time*)
prob = \[Psi]t[[2]].Conjugate[\[Psi]t[[2]]];
(*This represents the probablity of the pp' state, \[Psi]t[[2]].
We obtain it by multiplying the probabailty amplitud by its \
complex conjugate*)
AppendTo[temp, prob];
];
AppendTo[data, {\[CapitalDelta], Mean[temp]}];
];
ListPlot[data, Joined -> True]
ListPlot[{Eg1, Eg2}, Joined -> True]
![Graph attached][1]
Attachments: