Example codes
SimpleCode examples
TensorNetworkCodes.five_qubit_code
— Functionfive_qubit_code() -> SimpleCode
Return the five-qubit code.
TensorNetworkCodes.five_qubit_surface_code
— Functionfive_qubit_surface_code() -> SimpleCode
Return the five-qubit surface code.
TensorNetworkCodes.random_code
— Functionrandom_code(n::Int, k::Int) -> SimpleCode
Return a random code with n
physical qubits and k
logicals qubits.
An ErrorException
is raised if k
> n
.
TensorNetworkCodes.random_stabilizer_state
— Functionrandom_stabilizer_state(n::Int) -> SimpleCode
Return a random code with n
physical qubits and no logicals.
TensorNetworkCodes.steane_code
— Functionsteane_code() -> SimpleCode
Return the seven-qubit Steane code.
TensorNetworkCode examples
TensorNetworkCodes.almost_rotated_surface_code
— Functionalmost_rotated_surface_code(
L::Int64,
input_seed_code::SimpleCode,
input_coords::Array{Int64}) -> TensorNetworkCode
Generates a TensorNetworkCode
that is almost the rotated surface code. Requires the input_seed_code
to have five qubits and to be in the bulk (input_coords
with components not equal to 1 or L).
Examples
julia> code = almost_rotated_surface_code(3,five_qubit_code(),[2,2]);
julia> verify(code) # try this out and check we get a real code
true
TensorNetworkCodes.rotated_surface_code
— Functionrotated_surface_code(L::Int64) -> TensorNetworkCode
Generates the LxL rotated surface code as a TensorNetworkCode
.
Examples
julia> rot = rotated_surface_code(3);
julia> pauli_weight(rot.stabilizers[2]) # weight of a plaquette stabilizer
4
TensorNetworkCodes.surface_code
— Functionsurface_code(L::Int64)
Returns an (L+1) x L surface code TensorNetworkCode
.
Examples
julia> surf = surface_code(2);
julia> dist = find_distance_logicals(surf)[1] # code distance
3