3 #ifndef CPPQEDCORE_STRUCTURE_MATRIXOFHAMILTONIAN_H_INCLUDED
4 #define CPPQEDCORE_STRUCTURE_MATRIXOFHAMILTONIAN_H_INCLUDED
12 calculateMatrix(
const T& hamiltonian,
double t=0,
double t0=0)
16 static const int RANK=T::DIMESIONS_BOOKKEEPER_RANK;
19 const int dim=hamiltonian.getTotalDimension();
22 psi (hamiltonian.getDimensions()),
28 CVector psi1D(psi.vectorView());
30 const CVector dpsidt1D(dpsidt.vectorView());
33 for (
int row=0; row<dim; ++row) {
35 for (
int col=0; col<dim; ++col) {
37 ha->addContribution(t,psi.getArray(),dpsidt.getArray(),t0);
38 res(col,row)=
DCOMP_I*dpsidt1D(col);
52 #endif // CPPQEDCORE_STRUCTURE_MATRIXOFHAMILTONIAN_H_INCLUDED
CArray< 1 > CVector
Complex vector.
quantumdata::StateVector< 1 > StateVector
unary StateVector
State vector of arbitrary arity.
const dcomp DCOMP_I(0, 1)
Imaginary unit.
The interface every system having (possibly non-Hermitian) Hamiltonian time-evolution must present to...
Contains utilities for linear algebra.
CArray< 2 > CMatrix
Complex matrix.
Defines class of the same name.