pygsti.tools.symplectic#
Symplectic representation utility functions
Functions
|
Applies a clifford in the symplectic representation to a stabilizer state in the standard stabilizer representation. |
|
Applies a Clifford gate to the n-qubit Clifford gate specified by the 2n x 2n symplectic matrix. |
Get the bitstring corresponding to a Pauli. |
|
|
Converts an n-bit string b to an integer between 0 and 2^`n` - 1. |
|
Maps the input symplectic matrix between the 'standard' and 'directsum' symplectic form conventions. |
|
Checks whether a matrix is symplectic. |
|
Checks if a symplectic matrix - phase vector pair (s,p) is the symplectic representation of a Clifford. |
|
A helper routine used for manipulating stabilizer state representations. |
|
A helper routine used for manipulating stabilizer state representations. |
|
Multiplies two cliffords in the symplectic representation. |
Creates a dictionary of the symplectic representations of 'standard' Clifford gates. |
|
The number of Clifford gates in the n-qubit Clifford group. |
|
Returns the number of different cosets for the symplectic group S(n) over the 2-element finite field. |
|
The number of elements in the symplectic group S(n) over the 2-element finite field. |
|
|
Returns the "canonical" index of 2n x 2n symplectic matrix gn over the finite field containing 0 and 1. |
Returns the 2n x 2n symplectic matrix, over the finite field containing 0 and 1, with the "canonical" index i. |
|
|
Constructs a phase vector that, when paired with the provided symplectic matrix, defines a Clifford gate. |
|
Embeds the (s,p) Clifford symplectic representation into a larger symplectic representation. |
|
TODO: docstring pauli_labels defaults to ['I', 'X', 'Y', 'Z']. |
|
TODO: docstring |
|
Finds the Pauli layer that should be appended to a circuit to implement a given Clifford. |
|
Finds the Pauli layer that should be prepended to a circuit to implement a given Clifford. |
A utility function for selecting a random Clifford element. |
|
|
Converts integer i to an length n array of bits. |
|
Returns the inverse of a Clifford gate in the symplectic representation. |
Returns the inverse of a symplectic matrix over the integers mod 2. |
|
Gives the group relationship between the 'I', 'H', 'P' 'HP', 'PH', and 'HPH' up-to-Paulis operators. |
|
|
Computes the probabilities of 0/1 (+/-) outcomes from measuring a Pauli operator on a stabilizer state. |
|
Construct the (s,p) stabilizer representation for a computational basis state given by zvals. |
|
Returns a Clifford, in the symplectic representation, sampled uniformly at random from the n-qubit Clifford group. |
|
Generates a uniformly random phase vector for a n-qubit Clifford. |
|
The index of a uniformly random 2n x 2n symplectic matrix over the finite field containing 0 and 1. |
|
Returns a symplectic matrix of dimensions 2n x 2n sampled uniformly at random from the symplectic group S(n). |
|
Compute the probability of a given outcome when measuring some or all of the qubits in a stabilizer state. |
|
Creates the symplectic form for the number of qubits specified. |
|
Returns the symplectic inner product of two vectors in F_2^(2n). |
|
Takes a kronecker product of symplectic representations. |
|
Returns the symplectic representation of the composite Clifford implemented by the specified Clifford circuit. |
|
Constructs the symplectic representation of the n-qubit Clifford implemented by a single quantum circuit layer. |
|
Applies transvection Z k to v. |
|
Returns True if the unitary is a Clifford gate (w.r.t the standard basis), and False otherwise. |
|
Returns the symplectic representation of a one-qubit or two-qubit Clifford unitary. |