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

QRegister constructor from list / set / tuple #32

Open
ahelsing opened this issue Jun 13, 2019 · 2 comments
Open

QRegister constructor from list / set / tuple #32

ahelsing opened this issue Jun 13, 2019 · 2 comments

Comments

@ahelsing
Copy link
Contributor

Allow supplying a list, set, or tupleto theQRegister` constructor. That would ease certain uses.

See related issue #31.

ahelsing added a commit that referenced this issue Jun 25, 2019
 - if a single arg and it is int, handle specially
 - else for each Arg, allow it to be a tuple, list, QRegister, String, or a Qubit
  - QRegister: Append all qubits in the arg to the local set of qubits, ignoring any duplicates
  - String: Try parsing as 'q#' and append that to local set if not already present
  - Fix issue #31: Qubit: Try parsing name as 'q#' and append that to local set if not already present
  - Fix Issue #32: list/tuple: Recurse
ahelsing added a commit that referenced this issue Oct 11, 2019
 - Updates to working BasicSequences and notebooks, and up to date documentation
 - Addresses issues #55, #38
 - Also addresses #35, #32, #31
 - Also #26, #25, #21
@ahelsing
Copy link
Contributor Author

lists and tuples seem to work. sets still have trouble

@ahelsing
Copy link
Contributor Author

Symptom of set problem. Note the 0th element ends up at the end:

>>> a
QRegister('q1', 'q2', 'q3')
>>> set(a)
{QReference(QRegister('q1', 'q2', 'q3'), 1), QReference(QRegister('q1', 'q2', 'q3'), 2), QReference(QRegister('q1', 'q2', 'q3'), 0)}

ahelsing added a commit that referenced this issue Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant