-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from apkille/express
Migrate `express` and `AbstractRepresentation` type from QuantumSymbolics
- Loading branch information
Showing
5 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
express(obj, repr::AbstractRepresentation) | ||
express(obj, repr::AbstractRepresentation, use::AbstractUse) | ||
Translate a quantum object `obj` to a backend representation `repr`. It is relevant to define `use` | ||
for formalism-specific cases, e.g., for `QuantumCliffordRepr`. | ||
""" | ||
function express end | ||
|
||
"""An abstract type for the supported representation of quantum objects.""" | ||
abstract type AbstractRepresentation end | ||
abstract type AbstractUse end | ||
struct UseAsState <: AbstractUse end | ||
struct UseAsOperation <: AbstractUse end | ||
struct UseAsObservable <: AbstractUse end | ||
|
||
express(obj) = express(obj, QuantumOpticsRepr()) # The default representation | ||
express(s::Number, repr::AbstractRepresentation, use::AbstractUse) = s | ||
express(s, repr::AbstractRepresentation) = express(s, repr, UseAsState()) | ||
|
||
## | ||
# Commonly used representations -- interfaces for each one defined in separate packages | ||
## | ||
|
||
"""Representation using kets, bras, density matrices, and superoperators governed by `QuantumOptics.jl`.""" | ||
Base.@kwdef struct QuantumOpticsRepr <: AbstractRepresentation | ||
cutoff::Int = 2 | ||
end | ||
"""Similar to `QuantumOpticsRepr`, but using trajectories instead of superoperators.""" | ||
struct QuantumMCRepr <: AbstractRepresentation end | ||
"""Representation using tableaux governed by `QuantumClifford.jl`""" | ||
struct CliffordRepr <: AbstractRepresentation end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8f8c0e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
8f8c0e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/123143
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: