Types
Types representing quantum error correcting codes. An abstract type, QuantumCode
, defines the contract for all codes. SimpleCode
is a basic implementation that can be used as a seed code in a TensorNetworkCode
, which has an associated CodeGraph
.
Quantum code
TensorNetworkCodes.QuantumCode
— TypeAbstract supertype for quantum error correcting codes.
Subtypes should include the following fields:
stabilizers::Vector{Vector{Int}}
logicals::Vector{Vector{Int}}
pure_errors::Vector{Vector{Int}}
where stabilizers
are a linearly independent collection of stabilizer generators, logicals
are representatives of logical operators ordered as $X$-type, $Z$-type, ... for each logical qubit, and pure_errors
(or destabilizers) are operators the anticommute with the corresponding stabilizer generator and commute with all other stabilizer generators. Each of stabilizers
, logicals
and pure_errors
are collections of multi-qubit Pauli operators, see Pauli functions. The relationships between the operators can be checked using verify
.
Transformation and contraction functions do not modify stabilizers
, logicals
or pure_errors
fields directly but rather return new codes. Therefore these fields can be treated as immutable.
Simple code
TensorNetworkCodes.SimpleCode
— TypeSimpleCode <: QuantumCode
SimpleCode(name, stabilizers, logicals, pure_errors)
Simple named implementation of a quantum code.
Fields in addition to QuantumCode
:
name::String
This code contains no information on physical qubit layout but it can be used as a seed code in a TensorNetworkCode
.
TensorNetworkCodes.SimpleCode
— MethodSimpleCode()
Construct an empty simple code with empty string name.
TensorNetworkCodes.SimpleCode
— MethodSimpleCode(name, stabilizers, logicals)
Construct a simple code with pure errors evaluated using find_pure_errors
.
An ErrorException
is thrown if the pure errors cannot be evaluated; for example, if the stabilizers are not linearly independent.
Examples
julia> code = SimpleCode(
"5-qubit code",
[[1, 3, 3, 1, 0], [0, 1, 3, 3, 1], [1, 0, 1, 3, 3], [3, 1, 0, 1, 3]],
[[1, 1, 1, 1, 1], [3, 3, 3, 3, 3]]
);
julia> code.pure_errors
4-element Vector{Vector{Int64}}:
[0, 1, 0, 0, 0]
[1, 3, 0, 0, 0]
[3, 1, 0, 0, 0]
[1, 0, 0, 0, 0]
julia> verify(code)
true
TensorNetworkCodes.SimpleCode
— Method SimpleCode(code::TensorNetworkCode)
Construct a simple code from a tensor-network code with an empty string name.
The constructed code shares the stabilizers
, logicals
and pure_errors
with the given code.
See also TensorNetworkCode
.
Tensor-network code
TensorNetworkCodes.CodeGraph
— TypeCodeGraph
Type aggregating all geometrical data used by TensorNetworkCode
, including coordinates and ITensor
indices.
See also TensorNetworkCode
.
CodeGraph
is not typically accessed directly but rather created, read and updated using Transformation, Contraction and Code graph functions.
TensorNetworkCodes.TensorNetworkCode
— TypeTensorNetworkCode <: QuantumCode
TensorNetworkCode(stabilizers, logicals, pure_errors, code_graph, seed_codes)
Tensor-network implementation of a quantum code, with associated code graph and seed codes.
Fields in addition to QuantumCode
:
code_graph::CodeGraph
seed_codes::Dict{String,SimpleCode}
The code_graph
contains information on physical qubit layout. The seed_codes
are simple codes that are used to build the tensor-network code.
See also CodeGraph
.
The code_graph
and seed_codes
fields are not typically accessed directly but rather read and updated using Transformation, Contraction and Code graph functions.
TensorNetworkCodes.TensorNetworkCode
— MethodTensorNetworkCode(code::SimpleCode)
Construct a tensor-network code from a seed simple code and initialize the code graph with with appropriate defaults.
The constructed code shares the stabilizers
, logicals
and pure_errors
with the given code.
See also SimpleCode
.
Examples
julia> simple_code = five_qubit_code();
julia> tn_code = TensorNetworkCode(simple_code);
julia> verify(tn_code)
true