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

Add qubit state generation, truncation and expansion. #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Aug 22, 2021

Changes

  • Add truncation and expansion with qubit state
    • Truncate multi-level state into a qubit state discarding the non-computational basis.
    • Expand a qubit state to a multi-level state, filled with zeros.
  • Support a more general way of qubit state definition:
    • use a list or a string for zero/one/plus/minus state
    • use a list of integers for defining arbitrary disentangled quantum states (up to a global phase).
    • The parameter N is removed. It does not make sense to expand the input with zero states under the new definition. The number of the qubits should just be the same as the length of the input.

Question
Should the name be qubit_states or qubit_state?

@BoxiLi BoxiLi force-pushed the truncation branch 2 times, most recently from e2a89ed to b1aaea1 Compare August 22, 2021 21:51
@BoxiLi
Copy link
Member Author

BoxiLi commented Sep 1, 2021

@purva-thakre If you have time, would you like to take a review on this PR? Maybe the qubit_states function is interesting to you when you write tests etc further for the decomposition. You could try the functions a bit and ask for explanations/changes on whatever is not clear or you think is wrong. No need to push it if you are busy :)

@purva-thakre
Copy link
Contributor

@BoxiLi Sure, I could take a look (might take me a couple of days).

@purva-thakre purva-thakre self-requested a review September 1, 2021 12:21


def _find_reduced_indices(dims):
"""Find the forresponding indices for a given qu"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Find the forresponding indices for a given qu"""
"""Find all the qubit indices for a given dimension, e.g. ``[3, 4]``"""

Support a more general way of definition:
- use a list or a string for zero/one/plus/minus state
- use a list of integers for defining arbitrary disentangled quantum states (up to a global phase).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants