-
Notifications
You must be signed in to change notification settings - Fork 27
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
Representation + Wires refactor #498
Conversation
…refactorRepAnsatz
…refactorRepAnsatz
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.
What a truckload of good work!
thanks Anthony 🥇
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.
amazing work 🚀
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.
re-approved
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.
I like this PR so much I'm happy to keep re-approving it ^^
Context: One bottleneck currently in Mr Mustard is that
Representation
andWires
are treated separately when they are in fact very closely related. Here is presented an alternative implementation based on the Merging Representation and Ansatz PR. In this, we now have a singleRepresentation
class that contains the ansatz, the wires and a dictionary mapping wires to their respective representation.To consider: Remove ArrayAnsatz and only use PolyExp?
Description of the Change:
Representation
class.RepEnum
class.CircuitComponents
are initialized with aRepresentation
and a name. Exposed classes are still initialized with modes where they make use of the newfrom_modes
class method.fock
tofock_array
Benefits: We now have an object responsible for managing multi representations and keeping track of what wire each representation is. Fewer classes to maintain (6 -> 4). Clearer separation of responsibilities. Much cleaner codebase.