qiskit-community / qiskit-ignis

Ignis (deprecated) provides tools for quantum hardware verification, noise characterization, and error correction.
Apache License 2.0
167 stars 162 forks source link

Allow circuit generation to use integer labelled qubits #338

Closed chriseclectic closed 4 years ago

chriseclectic commented 4 years ago

What is the expected behavior?

When generating circuits in Ignis qubits and clbits should be able to be specified as an integer and not require using a QuantumRegister or ClassicalRegister object.

gadial commented 4 years ago

What is the expected interface? e.g. will the state tomography example

# Create the actual circuit 
q2 = QuantumRegister(6)
bell = QuantumCircuit(q2)
bell.h(q2[3])
bell.cx(q2[3], q2[5])
print(bell)

Should be changed to

# Create the actual circuit 
bell = IgnisQuantumCircuit(6)
bell.h(3)
bell.cx(2,5)
print(bell)

If so, maybe this is a change relevant to Terra as well? How are circuits usually used in Terra?

chriseclectic commented 4 years ago

You should be able to make an actual circuit either of those ways, its just that using the register is optional. So calling state_tomography_circuits(bell, [0, 4]) for doing 2-qubit tomography just on qubits 0 and 4 should work in both cases.

If you made the circuit while defining a quantum register, only in this case would you be able to call state_tomography_circuits(bell, [qr[0], qr[4]]), and that would be equivalent to the integer method to the underlying qubits the quantum register is referring to

Im not sure this is supported yet but you should also be able to permute the qubits in any order. Eg if I called

ShellyGarion commented 4 years ago

I went over the RB functions. The only function that gets qr as input is the following helper function (which is not part of the documentation since it does not generate the circuits directly): https://github.com/Qiskit/qiskit-ignis/blob/16ee0afe092dab4b5adf94af4ade03c9c150140f/qiskit/ignis/verification/randomized_benchmarking/circuits.py#L461 So, I don't think that it's necessary to change this API.

ShellyGarion commented 4 years ago

@cjwood @gadial - could you please look at the measurement mitigation code? the functions complete_meas_cal and tensored_meas_cal get qr as input, but this is only optional, see the tutorial: https://github.com/Qiskit/qiskit-iqx-tutorials/blob/master/qiskit/advanced/ignis/4_measurement_error_mitigation.ipynb

ShellyGarion commented 4 years ago

See the example for measurement error mitigation in ignis README: https://github.com/Qiskit/qiskit-ignis/blob/master/README.md

gadial commented 4 years ago

This was handled in #372 and #359 so I think it can be closed.