basic_functions

basic_functions#

Functions

column_echelon_form

compose_to_zero

Check whether two matrices multiply to give zero.

direct_sum_codes

Compute the direct sum of two codes (as chain or cochain complexes).

direct_sum_matrices

Compute the direct sum of two matrices.

dot_product

Takes the bilinear symmetric nondegenerate form, i.e. dot product, F_2^n x F_2^n -> F_2.

find_X_basis

Calculate a basis of X logical operators of a CSScode.

find_Z_basis

Calculate a basis of Z logical operators of a CSScode.

find_homology_basis

find_paired_basis

Calculate a paired basis of logical operators of a CSScode.

flip_code

Takes a CSS code and exchanges PX and PZ, giving a code with the same parameters but flipped Z and X generators.

image_all_vectors

Calculates all nonzero vectors in the image of a matrix.

image_basis_calc

Calculates a basis of the image of a matrix.

indices_to_vector

Converts a list of indices to a vector with support on those indices.

is_valid_CSScode

Check whether a CSScode is valid, i.e. the generators commute.

kernel_all_vectors

Calculates all nonzero vectors in the kernel of a matrix.

kernel_basis_calc

Calculates a basis of the kernel of a matrix.

max_measurement_support

Finds the maximum number of generators any single qubit in a CSScode is in the support of.

max_measurement_weight

Finds the maximum weight of any generator in a CSScode.

multiply_F2

Multiplies two matrices over F_2.

num_X_stabs

Finds the number of X-type stabiliser generators in a CSScode.

num_Z_stabs

Finds the number of Z-type stabiliser generators in a CSScode.

num_data_qubits

Finds the number of data qubits in a CSScode.

num_logical_qubits

Calculate the number of logical qubits of a CSScode.

systolic_distance

vec_addition

vector_to_indices

Converts a vector over F_2 to a list of entries that vector has support on.

Classes

CSScode

A qubit Calderbank-Shor-Steane code with a set of stabiliser generators is a pair of parity-check matrices over the field F_2.