-
Notifications
You must be signed in to change notification settings - Fork 10
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
Inverse state mapper #154
Inverse state mapper #154
Conversation
🚀 Deployed on https://deploy-preview-154--quri-parts.netlify.app |
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.
Moving post-selection filter functions from quri_parts.chem
to quri_parts.openfermion
is a breaking change, so let's note it explicitly in pull request description.
Some mappings require this argument (e.g. symmetry-conserving | ||
Bravyi-Kitaev transformation) while the others ignore it. | ||
n_up_spins: | ||
The number of spin orbitals. |
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.
This docstring needs to be updated.
I haven't read the post selection functions yet, but I have one question about the updated interface for incorporating the inverse mappers. |
I guess
|
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.
The code looks good to me overall. Just one slight concern.
Also, about the n_up_spins
should I add it in my PR later?
def augment_dropped_bits( | ||
self, | ||
bit_array: list[int], | ||
n_spin_orbitals: int, | ||
n_fermions: Optional[int] = None, | ||
) -> list[int]: | ||
# Add two qubits dropped by the fermion-to-qubit mapping. | ||
return bit_array + [0, 0] | ||
|
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'm wondering if this method should be public?
My concern is that for SCBK inverse mapping, we do not rearrange the dropped qubit back to the M/2-th and M-th qubit with this method (M is the number of spin orbitals.) Would this cause user's confusions if they decide to use it as a public method?
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.
Yeah, maybe we can make it private (or you can call it "protected", a term used in other programming languages like C++ or Java).
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 will make it protected in this PR
Thank you for your feedback!
This PR only considers restricted (OF's) transformations, so we don't need |
No description provided.