# Hamiltonian energy of a measured state

Hi,
let’s assume I created Schrodinger problem in Braket and executed it on Aquila:

``````H = Hamiltonian()
drive = get_drive(time_points, omega_values, detuning_values, phase_values)
H += drive
ahs_progr = AnalogHamiltonianSimulation(  register=register, hamiltonian=H)
``````

This gives me dictionary with measured shots per bistrring, e.g.:
‘gggrgrggrrgrgrgrgrrgrgrgrgrrgrgrgrgrrggrgrggr’: 132,
‘ggrgrgrgrrgrergrgrrgrgrgrgrrgrgrgggrrgggrgrgr’: 71,
‘grgrgrgrgrgrgrrggrrgggrgrgrrgrgrgrgrrgrggrgrg’: 42,

I’d like to compute energy of each measured state at arbitrary time , like this

``````for  bitstr in rawBitstr:
ene = ahs_progr.energy(bitstr, time=1.3e-6)
``````

How can I do it?
ahs_prog object knows everything about the atoms placement and about the driving fields at any time.
Thanks
Jan

Hi Jan,

two things:

1. Because you have shots taken in one basis you can only access the diagonal part of the density matrix so having a method to measure the energy at an abitrary times, but you can measure the energy at the end of the evolution
2. There is currently no implementation for energy at the end of the evolution implemented in the braket sdk. I would encourage you to submit a github issue to ask for them to potentially implement this.

Best,

Phil

Hi Phil,
Ad 2: it is 20 lines of code: find all pairs of 1-states and compute the van der Waals terms, next compute hamming weight and multiply by the final value of Delta.
Add all of it together. I’m almost done.

Is my understanding correct I’ll get energy in Jules, if I use C6=5.42E-24, Hz for Delta, and meters for positions?
Thanks
Jan

there must be some h=1 constant ignored in the formula for the van der Waals term.
At the face value, if energy is C6/r^6, than for
C6=5.42E-24 and r=6 um I’d get
5.24e-24/(6e-6)^6=112MJ of energy.
And 1 MJ is approximately equal to the energy released by burning 0.24 gallons (or 0.9 liters) of gasoline.
Your Aquila is not nuclear powered and has no 10 cooling towers

follow up. Now I see I forgot about the hbar=1.05457182e-34 # in (J s).
The revised formula for the Van der Waals energy of 2 atoms spaced by 6 um would be now
5.24e-24/(6e-6)^61e-341e12= 1.1e-14(pJ) (pico-Joule)
is this value reasonable to you?

Yes that looks good to me