-
Notifications
You must be signed in to change notification settings - Fork 104
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
ParticuleBasis #339
Comments
We could, but I don't really see a use for it. If you just want to dispatch on this in a script, you can also do something like const ParticleBasis = Union{<:MomentumBasis,<:PositionBasis}
function f(b::ParticleBasis)
# do stuff
end What do you want to achieve here? |
I want to define many functions that work the same for both momentum and position basis. Stuff like create(b::ParticuleBasis) = (position(b) + im * momentum(b)) / sqrt(2)
destroy(...) = ...
displace(...) = ...
squeeze(...) = ...
... I also want to define some operators on a composite particule and spin basis. I know the difference in runtime between the union and abstract type version is marginal, but I find the abstract type version cleaner. |
Hello, I was wondering if you could add a
ParticuleBasis
abstract type such thatThe text was updated successfully, but these errors were encountered: