guppyalgos.primitives.pauli¶
Pauli operator primitives.
Functions
|
Produce a Guppy function for \(e^{i\pi\phi}P\) under one control. |
|
Produce a guppy function to apply a zixy String. |
|
Produce a guppy function to change basis to/from Z-basis for a zixy String. |
- guppyalgos.primitives.pauli.pauli_to_cntrl_gate(pauli_string, size, phase=0.0)¶
Produce a Guppy function for \(e^{i\pi\phi}P\) under one control.
The phase is applied once to the active control branch. If this operation is itself controlled, the phase gate must be promoted to
cphaseso that it is applied only when both controls are active.
- guppyalgos.primitives.pauli.pauli_to_gate(pauli_string, size)¶
Produce a guppy function to apply a zixy String.
- Parameters:
pauli_string (zqp.String) – zixy string for the Pauli to be applied
size (int) – size of the register to apply the Pauli on
- Return type:
GuppyFunctionDefinition[array[qubit,TypeVar(n_q, bound=nat)],None]- Returns:
GuppyFunctionDefinition that takes in a qarray[size] and applies the pauli.
- guppyalgos.primitives.pauli.pauli_to_z_basis(pauli_string, size, dagger=False)¶
Produce a guppy function to change basis to/from Z-basis for a zixy String.
Maps the given Pauli to the Z-basis (or from Z-basis if dagger=True) on a register of given size. Typically should be used as a pair for a GPG^dagger change of basis surrounding a Pauli operation.