Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute oscillator eigenstate for any angle #234

Closed
1 task done
elib20 opened this issue Mar 23, 2023 · 2 comments
Closed
1 task done

Compute oscillator eigenstate for any angle #234

elib20 opened this issue Mar 23, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@elib20
Copy link
Contributor

elib20 commented Mar 23, 2023

Before posting a feature request

  • 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

@elib20 elib20 added the enhancement New feature or request label Mar 23, 2023
@ziofil
Copy link
Collaborator

ziofil commented Mar 23, 2023

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)

@ziofil
Copy link
Collaborator

ziofil commented Jul 18, 2024

This is available in lab_dev now

@ziofil ziofil closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants