qiskit-qec
qiskit-qec copied to clipboard
Create Paulis of specific number of qubits
Consider trying to create the following Pauli on 100 qubits: Z0
or in product form IIIII...IIIIZ
with 99 I
's. If you do the following
Pauli("Z0")
you will get simply Z0
on one qubit. Instead, add the optional parameter num_qubits and do the following:
Pauli("Z_0", num_qubits = 100)
or
Pauli("Z", num_qubits = 100)
For Z_5
on 8 qubits the the code
Pauli("Z5", num_qubits = 8)
should produce the Pauli "IIZIIIII"
Note that you can do this in a Hack way by first creating
PauliList(["IIIIIIII", "Z5"])
and then extracting the Pauli of interest.
We should also add this functionality to PauliList
.