MrMustard
MrMustard copied to clipboard
Compute oscillator eigenstate for any angle
Before posting a feature request
- [x] I have searched exisisting GitHub issues to make sure the feature request does not already exist.
Feature details
In physics.fock, there is a function to compute the Fock representation of oscillator eigenstates for the q-quadrature, i.e. <n|q>. It is simple to compute <n|R(phi)|q>=exp(i*n)<n|q> as well, but I am not good enough at tensorflow to figure out how to implement this myself.
Implementation
Provide an extra phi argument to the function, and wherever the loop over n occurs, just add the extra complex phase to each term.
How important would you say this feature is?
2: Somewhat important. Needed this quarter.
Additional information
No response
if you are in a hurry this should work:
cutoff = 10
phase = 0.5
q = math.arange(-1,1,0.1)
exp_iphin = 1j*math.cast(phase * math.arange(cutoff), 'complex128')
q_to_n = math.cast(oscillator_eigenstate(q, cutoff), 'complex128')
exp_iphin[:,None] * q_to_n
(double check the signs)
This is available in lab_dev now