I am very new to quantum computing and only recently started learning Qiskit, so the question may sound a bit silly.
Essentially, when I create a QuantumCircuit
object, I want to be able to access an individual qubit of the quantum circuit by the name of the qubit. So far, I have looked at various sources online, but none of them helped me.
More concretely, given a QuantumCircuit
object, say qc
, I want to do the following:
q = qc['p0'] # Assume that p0 is a qubit name
Also, suppose I have to add a quantum gate to one or more qubits in the quantum circuit. Currently, I know how to do this using the qubit indices in the quantum circuit. But can I do this using the qubit names?
Change
qc.append(HGate(), [0])
to something like
qc.append(HGate(), ['p0']) # p0 is a qubit name
Are there any methods to achieve what I want? Any help would be highly appreciated!