We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I was wondering if you could add a ParticuleBasis abstract type such that
ParticuleBasis
PositionBasis <: ParticuleBasis MomentumBasis <: ParticuleBasis
The text was updated successfully, but these errors were encountered:
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?
Sorry, something went wrong.
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.
No branches or pull requests
Hello, I was wondering if you could add a
ParticuleBasis
abstract type such thatThe text was updated successfully, but these errors were encountered: