Skip to content
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

QubitConverter Refactoring #967

Closed
mrossinek opened this issue Nov 16, 2022 · 1 comment · Fixed by #1073
Closed

QubitConverter Refactoring #967

mrossinek opened this issue Nov 16, 2022 · 1 comment · Fixed by #1073
Assignees
Labels
Milestone

Comments

@mrossinek
Copy link
Member

What should we add?

We should refactor the QubitConverter and QubitMapper classes to achieve the following goals.

Removal of qiskit.opflow

Qiskit Terra plans to deprecate qiskit.opflow in favor of qiskit.quantum_info in the next release (0.23). The primitives and new algorithms based on them already largely switched over to quantum_info objects and only kept support of the PauliSumOp because of its coupling to the Z2Symmetries. In this Epic, I will outline our plans around Z2Symmetries to allow us removing this final opflow dependence.

One step needs to be done in Terra and the corresponding issue is Qiskit/qiskit#9140.

Then we also need get rid of the TwoQubitReduction. Since this particular transformation is unique to the ParityMapper of Qiskit Nature, I suggest that we fully extract it from Qiskit Terra and migrate it to here.

Enabling direct usage of QubitMappers

In a far future, the usage of Z2Symmetries will not yield as much of a significant advantage as nowadays (think removal of a handful of qubits from a multi-hundred/multi-thousand qubit-sized problem). Thus, we should already prepare for an API where QubitMapper objects can be used directly.

Especially if we integrate the TwoQubitReduction directly into the ParityMapper, each mapper will be more useful as a standalone object, too.

Making a standalone TaperedQubitMapper

With the changes proposed above, one could fully rethink how we can implement the tapering utilities evolving around the Z2Symmetries which will remain in Terra. In fact, one could envision a standalone TaperedQubitMapper, which takes any other mapper and all the information necessary to determine the Z2Symmetries during instantiation.
This class could then implement a 2-step mapping procedure where the operators are first mapped and then tapered. This would be a stateful mapper since the symmetries are determined based on the hamiltonian and subsequent additional operators are reduced accordingly.

If in the future we decide to remove Z2Symmetries, this class can simply be deprecated without further affecting the stack.

Removing QubitConverter

Doing all of the above, will allow us to simply deprecate the QubitConverter as it will be replaced (in-place) by any QubitMapper instance. This also greatly simplifies the usage of simple mappers for any end-user 👍


MixedMapper

This refactoring will also greatly simplify the introduction of a MixedMapper which is required for the implementation of #795.

@mrossinek mrossinek added the Epic label Nov 16, 2022
@mrossinek mrossinek added this to the 0.6.0 milestone Nov 16, 2022
@Anthony-Gandon
Copy link
Contributor

I will gladly participate to this refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants