ベスパリブ

プログラミングを主とした日記・備忘録です。ベスパ持ってないです。

2022-05-01から1ヶ月間の記事一覧

'One or more instructions cannot be converted to a gate. "barrier" is not a gate instruction' エラー

環境 qiskit-terra 0.20.1 qiskit 0.36.1 Python version 3.10.4 本題 以下のコードを実行すると、表題のエラーが発生します。 from qiskit import QuantumCircuit qc = QuantumCircuit(1) qc.x(0) qc.barrier() gate = qc.to_gate() ----------------------…