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

Introducing Qubits and Clbits classes #2414

Merged
merged 113 commits into from
May 21, 2019
Merged

Introducing Qubits and Clbits classes #2414

merged 113 commits into from
May 21, 2019

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented May 14, 2019

This PR introduces Qubit and Clbit classes to replace our tuple-based notion.

Fixes #1898
Fixes #2056
Fixes #1647

@kdk kdk merged commit 79c44e5 into Qiskit:master May 21, 2019
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request May 23, 2019
@1ucian0 1ucian0 deleted the no_tuple_bits branch May 24, 2019 10:10
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
* bit class

* compare to tuple

* hashable bits

* iter

* getitem

* avoid duplication of code

* test_barrier_none

* allow direct access to index and register

* layout

* snapshot

* conditional

* defintions

* layout

* test.python.circuit.test_circuit_registers.TestCircuitRegisters.test_measure_slice

* removing some tuple representation

* removing some tuple representation

* repr

* None

* test.python.transpiler.test_layout

* dag

* test.python.compiler.test_compiler.TestCompiler.test_compile_single_qubit

* test.python.compiler.test_compiler

* order

* StochasticSwap

* lint

* register have order

* lint

* test.python.visualization.test_visualization

* test.python.visualization.test_circuit_text_drawer

* test.python.basicaer.test_basicaer_integration

* test.python.compiler.test_transpiler

* test.python.transpiler.test_remove_diagonal_gates_before_measure

* test.python.transpiler.test_stochastic_swap.TestStochasticSwap

* test.python.transpiler.test_unroller

* test.python.circuit.test_circuit_registers

* test.python.transpiler.test_noise_adaptive_layout

* test.python.quantum_info.operators.test_operator.TestOperator

* mappers

* pickles

* latex lint

* test.python.transpiler.test_full_ancilla_allocation

* test.python.transpiler.test_consolidate_blocks

* test.python.transpiler.test_commutative_cancellation

* test.python.transpiler.test_basic_swap

* test.python.quantum_info.operators.channel.test_superop

* lint qiskit/converters/ast_to_dag.py

* test/python/test_dagcircuit.py

* test/python/test_dagcircuit.py

* test.python.compiler.test_assembler

* test.python.circuit.test_unitary

* condition

* test.python.circuit.test_circuit_properties

* instruction.control

* lint

* latex condition

* qiskit/dagcircuit/dagcircuit.py

* qiskit/circuit/quantumcircuit.py

* qiskit/assembler/assemble_circuits.py

* test for 1898

* Qiskit#2414 (comment)

* docstrings

* removing order by comparing sets in Collect2qBlocks

* QuBit-> Qubit and ClBit-> Clbit

* errors

* lint

* QuBit -> Qubit

* ctrl_reg, ctrl_val = instruction._control

* https://github.com/Qiskit/qiskit-terra/pull/2414/files/ff8770f7b195f66997a45f01943059d1c6ffaf13#r284695050

* explicit globals

* lint

* __getitem__ for deprecation

* from_tuple

* new pickles

* docstring

* accept gate arguments as tuples and mark them as deprecated

* this fix contradicts whats expected from a negative key lookup

* promote __iter__

* simpler negative index check...

* https://github.com/Qiskit/qiskit-terra/pull/2414/files#r284542889

* docstring lint

* getitem

* layout backwards compatibility

* lint

* lint!

* deprecated messager only when _is_bit

* changelog

* expose less the contructor

* remove prints and raised text

* simplifications

* lint
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Aug 13, 2019
With the introduction of the Bit classes in Qiskit#2414 the arguments for
many of the methods in the DAGCircuit class, which often deal with
individual bits, were changed to deal with these new classes instead of
tuples. However, in that process a couple of docstrings were missed and
not updated to reflect the expected types. This commit corrects the
oversight and updates the docstrings for those cases.

Fixes Qiskit#2820
ajavadia pushed a commit that referenced this pull request Aug 14, 2019
* Update dagcircuit docstrings for bit class arguments

With the introduction of the Bit classes in #2414 the arguments for
many of the methods in the DAGCircuit class, which often deal with
individual bits, were changed to deal with these new classes instead of
tuples. However, in that process a couple of docstrings were missed and
not updated to reflect the expected types. This commit corrects the
oversight and updates the docstrings for those cases.

Fixes #2820

* Update one more docstring and error message access
mtreinish added a commit to mtreinish/qiskit-tutorial that referenced this pull request Aug 20, 2019
This commit fixes a few issues in the parallel when running on the
latest version of terra. The biggest issues is the
qiskit.quantum_info.synthesis.two_qubit_kak() function was renamed prior
to the 0.8 release to two_qubit_decompose() (from what I can tell
two_qubit_kak() in quantum_info synthesis was never included in a
release, although I might have missed it in my git log hunting). This
updates the call to use the proper function name. In addition because
of Qiskit/qiskit#2414 all bit level access as tuples has been
deprecated and will emit a warning, to remove the warnings this changes
the access to be attributes instead.
jaygambetta pushed a commit to Qiskit/qiskit-tutorials that referenced this pull request Aug 20, 2019
This commit fixes a few issues in the parallel when running on the
latest version of terra. The biggest issues is the
qiskit.quantum_info.synthesis.two_qubit_kak() function was renamed prior
to the 0.8 release to two_qubit_decompose() (from what I can tell
two_qubit_kak() in quantum_info synthesis was never included in a
release, although I might have missed it in my git log hunting). This
updates the call to use the proper function name. In addition because
of Qiskit/qiskit#2414 all bit level access as tuples has been
deprecated and will emit a warning, to remove the warnings this changes
the access to be attributes instead.
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* Update dagcircuit docstrings for bit class arguments

With the introduction of the Bit classes in Qiskit#2414 the arguments for
many of the methods in the DAGCircuit class, which often deal with
individual bits, were changed to deal with these new classes instead of
tuples. However, in that process a couple of docstrings were missed and
not updated to reflect the expected types. This commit corrects the
oversight and updates the docstrings for those cases.

Fixes Qiskit#2820

* Update one more docstring and error message access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants