Skip to content

Commit

Permalink
Revert "Fix instruction inheritance issues (#1900)" (#1906)
Browse files Browse the repository at this point in the history
This reverts commit 36d5d5d.
  • Loading branch information
ajavadia authored Mar 6, 2019
1 parent 36d5d5d commit 1d8d386
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ The format is based on `Keep a Changelog`_.
`UNRELEASED`_
=============


`0.7.2`_ - 2019-03-05
=====================


Fixed
-----

- Fixed a bug whereby inheriting from QuantumRegister or ClassicalRegister
would cause a QiskitError in instruction.py

`0.7.1`_ - 2019-03-04
=====================

Expand Down
4 changes: 2 additions & 2 deletions qiskit/circuit/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def __init__(self, name, param, qargs, cargs, circuit=None):
Raises:
QiskitError: when the register is not in the correct format.
"""
if not all(isinstance(i[0], QuantumRegister) and isinstance(i[1], int) for i in qargs):
if not all((type(i[0]), type(i[1])) == (QuantumRegister, int) for i in qargs):
raise QiskitError("qarg not (QuantumRegister, int) tuple")
if not all(isinstance(i[0], ClassicalRegister) and isinstance(i[1], int) for i in cargs):
if not all((type(i[0]), type(i[1])) == (ClassicalRegister, int) for i in cargs):
raise QiskitError("carg not (ClassicalRegister, int) tuple")
self.name = name
self.param = [] # a list of gate params stored as sympy objects
Expand Down

0 comments on commit 1d8d386

Please sign in to comment.