qiskit_qec.linear.create_lambda_matrix

create_lambda_matrix(n)[source]

Creates the GF(2) Lambda matrix

[0 I_n] [I_n 0]

Parameters:

n (int) – Size of identity matrix to use

Return type:

ndarray

Returns:

GF(2) Lambda matrix used in the GF(2) symplectic product

Raises:
  • QiskitError – n must be a positive integer

  • QiskitError – n must be an integer

Examples

>>> x = create_lambda_matrix(2)
>>> x.astype(int)
array([[0, 0, 1, 0],
       [0, 0, 0, 1],
       [1, 0, 0, 0],
       [0, 1, 0, 0]])

See Also: _create_lambda_matrix