You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.
CircuitError Traceback (most recent call last)
<ipython-input-27-e8ddb0ce8be9> in <module>
----> 1 oracle = TruthTableOracle(bitmap, optimization = True, mct_mode = 'basic')
2 oracle.circuit.num_qubits
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/components/oracles/truth_table_oracle.py in __init__(self, bitmaps, optimization, mct_mode)
134 ] if esop_exprs else None
135
--> 136 self.construct_circuit()
137
138 def _get_esop_ast(self, bitmap):
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/components/oracles/truth_table_oracle.py in construct_circuit(self)
214 mct_mode=self._mct_mode
215 )
--> 216 self._circuit += ci
217 self._variable_register = self._ancillary_register = None
218 for qreg in self._circuit.qregs:
/opt/conda/lib/python3.7/site-packages/qiskit/circuit/quantumcircuit.py in __iadd__(self, rhs)
442 def __iadd__(self, rhs):
443 """Overload += to implement self.extend."""
--> 444 return self.extend(rhs)
445
446 def __len__(self):
/opt/conda/lib/python3.7/site-packages/qiskit/circuit/quantumcircuit.py in extend(self, rhs)
335 """
336 # Check registers in LHS are compatible with RHS
--> 337 self._check_compatible_regs(rhs)
338
339 # Add new registers
/opt/conda/lib/python3.7/site-packages/qiskit/circuit/quantumcircuit.py in _check_compatible_regs(self, rhs)
706 if element2.name == element1.name:
707 if element1 != element2:
--> 708 raise CircuitError("circuits are not compatible")
709
710 def qasm(self, formatted=False, filename=None):
CircuitError: 'circuits are not compatible'
Steps to reproduce the problem
First load some basic libraries
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
# Loading your IBM Q account(s)
provider = IBMQ.load_account()
from qiskit.aqua.components.oracles import Oracle, TruthTableOracle
from qiskit.circuit import QuantumRegister, ClassicalRegister, QuantumCircuit, Qubit
import math
import numpy as np
Then define the following bitmap (this is funny because if you change the bitmap the error might not happen)
Information
What is the current behavior?
Steps to reproduce the problem
First load some basic libraries
Then define the following bitmap (this is funny because if you change the bitmap the error might not happen)
what returns
64
in all cases as expected. Finally callWhat is the expected behavior?
Returns an ordinary oracle from the class TruthTableOracle.
Suggested solutions
If one changes the bitmap, the optimization, or the mct_mode, the error dissapears. However, the problems seems deep into qiskit.
The text was updated successfully, but these errors were encountered: