0
$\begingroup$

I was learing about scheduling. So, to test scheduling for a 2 qubit circuit I tried to run this code but found error

from qiskit.test.mock import FakeAlmaden
from qiskit import QuantumCircuit, transpile

qc2 = QuantumCircuit(2)
backend = FakeAlmaden
new_qc2 = transpile(qc2, backend)
new_qc2.draw()
TypeError: configuration() missing 1 required positional argument: 'self'
$\endgroup$
1
  • $\begingroup$ Hi and welcome to Quantum Computing SE. Could you please post the error message as well? $\endgroup$ Feb 27, 2022 at 21:57

2 Answers 2

1
$\begingroup$

Transpile takes a Backend instance, not type. In order words, you are missing the () after FakeAlmaden:

from qiskit.test.mock import FakeAlmaden
from qiskit import QuantumCircuit, transpile

qc2 = QuantumCircuit(2)
backend = FakeAlmaden()
new_qc2 = transpile(qc2, backend)
new_qc2.draw()
$\endgroup$
0
$\begingroup$

I think you have missed a parenthesis while defining the backend. The following code is working fine .
from qiskit.test.mock import FakeAlmaden
qc2 = QuantumCircuit(2)
backend = FakeAlmaden()
new_qc2 = transpile(qc2, backend)
transpiled_qc2.draw()
I see the output to be -
enter image description here

$\endgroup$
1
  • $\begingroup$ Ya. I missed the bracket. Thanks $\endgroup$ Feb 28, 2022 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.