Closed yangcal closed 6 months ago
thanks for the report. identified as a bug in qiskit for cu
gate: the base gate matrix is not consistent with the gate matrix provided by cu
, and this will induce error in the translation.
qc = qiskit.QuantumCircuit(2)
qc.cu(5.868768495722669, 2.24809352294186, 3.59102783505607, 2.0223650288392, 1, 0)
print(qc.data[0][0].to_matrix(), qc.data[0][0].base_gate.to_matrix())
Therefore, CU
gate in qiskit may fail tc translation due to this inconsistent bug in qiskit. I am considering to take special care in tc on this case for new releases to avoid the qiskit bug.
fixed in fc2fb0650e40a019ae18ec4cabd0a79cc2b0f041
Hello, I found some issues in
tensorcircuit.Circuit.from_qiskit
. For some qiskit circuit, the state vector computed by qiskit and tensorcircuit differs. Reproducer below:with
qiskit 0.45.0
, I'm seeingqiskit versus tc err 0.024371880366666862