-
Notifications
You must be signed in to change notification settings - Fork 197
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
Implement the QubitMappers #18
Comments
Creator: @mrossinek You can find an example of the new Jordan-Wigner mapping in action here: |
Creator: @woodsp-ibm Can we look at avoiding
|
Creator: @pbark @woodsp I think that the idea behind this is that not all mappings work with all type of operators. e.g. if one provides a BosonicOperator in the JW mapping this is not going to work. Sure we can try to think ways of spliting the mappings (e.g. FermionicMappings VS BosonicMappings) but I am not sure how much complicated this can be. |
Creator: @mrossinek I partially agree with @woodsp here. The
I am not sure which EDIT: I didn't see @bpa comment before posting. You are absolutely right too! We definitely do need some mechanism for checking that the type matches but I think @woodsp is proposing a solution which circumvents the |
Creator: @woodsp-ibm I think I was looking at this, since its in the Mapping base class, where it seemed there was already some type notion, and where ParticleOperator seemed to define the type via a string if I recall.
Whether this is useful or not it would be nice to avoid |
Creator: @mrossinek That's a good point! Both, the In either case, we would have to update this function call anyways because now that we split the primitives out the
Instead, we can now just do:
and use the |
We would like to remove all of the mapper logic from the operators in order to cleanly separate this module. One motivation is that in the future we may not need to map these operators for all possible backends which we may want to use. To make this more concrete with an example, the JordanWigner mapper would translate in the following style:
(respecting the qubit ordering in Qiskit) The BKSF mapping can also be implemented in such a style as the edge list can be inferred from fermionic labels containing
where the above example means that |
I am wondering whether there should just be FermionicMapper, BosonicMapper and SpinMapper base classes with a map taking their respective Operator and returning a PauliSumOp. Mapping a mixed 2ndQOp requires doing the mappings against each of the types in there - I am struggling to see where bringing this to that level of a SecondQuantizedQubitMapper abstraction is of benefit. As a parallel to 2ndQOp would a 2ndQOpMapper not be expected to contain a FermonicMapper, a BosonicMapper and SpinMapper in a similar way that the 2ndQOperator contains one of each operator types should such a class exist? |
Yes I think class MixedMapper():
def __init__(self, fermionic, bosonic, spin):
...
def map(self, second_q_op):
fermionic_paul_op = self.fermionic.map(second_q_op.fermionic)
... Obviously the name can be made whatever we like 👍 |
All mappers which will be part of the upcoming release are finished. The remaining ones will be tracked in their own issues:
Thus, I am closing this broader issue in favor of these other ones. |
Reopening the issue for planning and making it an Epic |
The final mapper tracked by this Epic was just merged into |
Migrated from Enterprise Github.
Creator: @mrossinek
The state of the QubitMappers is the following:
DirectMapper (bosonic)DirectMapper (bosonic)Note: this issue may be broken down into several issues as work starts to progress.
The text was updated successfully, but these errors were encountered: