When we create a hamiltonian using the function “hamiltonian = rydberg_h(…)”, we have the possibility to visualize its matrix representation through the command “mat(hamiltonian)”. I would like to know if there is a way to build a hamiltonian declaring its matrix directly, without using the “rydberg_h” function, to then simulate it with “prob = SchrodingerProblem(reg, t , hamiltonian)”.
It would perhaps be something like:
Declaring Hamiltonian
hamiltonian = [0 1; 1 0];
Solving Schrodinger’s equation
prob = SchrodingerProblem(reg, t , hamiltonian)
emulate!(prob)
Unfortunately there isn’t really a way to go about this in Bloqade. Bloqade isn’t designed to be a general purpose simulator which means it wasn’t designed with the ability to load custom matrices.