-
Notifications
You must be signed in to change notification settings - Fork 619
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
Dimension overhaul #1826
Closed
Closed
Dimension overhaul #1826
Conversation
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
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is an overhaul of the dimensions based on the proposition by @jakelishman in #1476.
As proposed, dimension objects singleton instances composed of map and spaces.
Dimensions used by
Qobj
are all represented by a map between 2 spaces:...
This
Dimension
is theMap
proposed by Jake, butket
are map fromField
toSpace
and not Spacethemselves. Spaces come into multiple sub classes as proposed :
Space,
SuperSpace,
Field,
Compound, and
EnrSpace. Splitting maps and spaces simplify spaces by not needing to have a dummy 2nd dims :
Space()[1]` does exist.Dimensions can be initiated from a list and converted back to one. Field are automatically contracted:
Compound(Field, Field)
is aField
, same for maps. With the exceptions thatQobj
with a shape of(1,1)
with be aDimensions(Field, Field)
and not aField
.Some previously valid and used list format are no longer accepted. Playing with of tensor of super operators,
permute
andreshuffle
, you could make object with dims as[[[2, 2], [3, 3], [4, 4]], [[2, 2], [3, 3], [4, 4]]]
which can be interpreted as the tensor of 3 super operators. But then[[[2, 2], [3, 3]], [[2, 2],[3, 3]]]
can both be interpreted as tensor of super operator or super operator of tensor spaces, so :[[[2, 2], [3, 3], [4, 4]], [[2, 2], [3, 3], [4, 4]]]
: Error[[[2, 2], [4, 4]], [[2, 2], [4, 4]]]
: list representation of dimensions ofto_super(tensor(oper, oper))
[[[2], [2], [3], [3]], [[2], [2], [3], [3]]]
: list representation of dimensions oftensor(to_super(oper), to_super(oper))
Dimensions object have a
type
andshape
set a initialization. There is a check when creating/ modifying aQobj
with between the data's shape and dims's shape and an error is raise when they are not matching.Since operator-ket have a
superrep
, I added thesuperrep
parameter to the Superspace instead of the dimensions, for now. But a better look at super operator representation is needed.At the present state,
Qobj.dims
take and return a list, keeping the dimension object internally. From there, minimal adjustment were made so test pass.The eigenstate fix in #1820 is already merged since it would create
Qobj
which dims and shape did not match.ToDo:
Related issues or PRs
#1476
Changelog