0
$\begingroup$

In qiskit if i have a reset gate in a circuit. If i want to add noise to the circuit it wont transpile.

For example:

qr= QuantumRegister(2)
qc = QuantumCircuit(qr)
qc.reset(qr)
noise_model = NoiseModel()
sim = AerSimulator(method='matrix_product_state', noise_model=noise_model)
transpiled_qc = transpile(qc, sim, optimization_level=0)
res = sim.run(transpiled_qc, shots=10).result()

Will fail with the error message: "HighLevelSynthesis was unable to synthesize Instruction(name='reset', num_qubits=1, num_clbits=0, params=[])."

But I remove the noise_model:

qr= QuantumRegister(2)
qc = QuantumCircuit(qr)
qc.reset(qr)
noise_model = NoiseModel()
sim = AerSimulator(method='matrix_product_state')
transpiled_qc = transpile(qc, sim, optimization_level=0)
res = sim.run(transpiled_qc, shots=10).result()

It will successfully transpile and run. Is this a qiskit bug or am i doing something wrong?

$\endgroup$
2

0

Your Answer

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