qiskit_qec.codes.small_code

small_code(n, k, index, info_only=False)[source]

Returns the [[n,k]]-index code in the library.

Parameters:
  • n (int) – number of physical qubits

  • k (int) – number of encoded qubits

  • index (int) – Unique index for the [[n,k]] code

  • info_only (bool) – If True then only a Properties object will be returned containing

  • in (information about the code requested. If False then a Code will be returned)

  • False. (a suitable Code subclass. Defaults to)

Raises:
  • QiskitError – n, number of physical qubits, must be specified.

  • QiskitError – k, number of encoded qubits, must be specified.

  • QiskitError – index, index assigned to the requested [[n,k]] code, must be specified.

Returns:

Returns the [[n,k]]-index Code if info_only is False and a Properties object if the info_only is True.

Return type:

Union[Code, Properties]

Example

>>> code_info = small_code(5,2,0, info_only=True)
>>> code_info.info
    [[5,2]]-0 StabSubSystemCode
    -------------------------------------------------------------------------------
    isotropic_generators : ['X0X2', 'Z1Z4', 'Z0Z2']
    logical_ops          : ['X3', 'X1X4', 'Z3', 'Z4']
    is_subsystem         : 1
    index                : 0
    code_type            : StabSubSystemCode
    aut_group_size       : 576
    is_decomposable      : 1
    weight_enumerator    : [1, 0, 4, 0, 3, 0]
    is_css               : 1
    uuid                 : 47e52342-8ffc-48e5-be51-c60aab28e9b8
    is_degenerate        : 0
    d                    : 1
    is_gf4linear         : 0
    k                    : 2
    n                    : 5
>>> code = small_code(5,2,0)
>>> code.gaugegroup.generators
    PauliList(['X0X2', 'Z1Z4', 'Z0Z2'])

Note

This is the equivalent to the GAP method SmallGroup but for codes