qat.synthopline.linear_synthesis.random_linear_operator
- qat.synthopline.linear_synthesis.random_linear_operator(nbqbits)
Generate a random linear operator over nbqbits qbits.
The output operator is generated using \(O(n^2)\) line operations, which, on average, produces operator with high CNOT complexity.
Note
The seed of the generator can be controlled using numpy’s random.seed method.
import numpy as np from qat.synthopline.linear_synthesis import random_linear_operator np.random.seed(23) table = random_linear_operator(10) print(table)
[[1 0 0 1 1 1 0 0 1 1] [1 1 1 1 0 0 1 1 1 1] [0 0 1 0 0 0 0 0 0 0] [0 1 0 1 0 1 0 0 0 1] [0 0 0 0 0 1 0 1 1 1] [0 1 1 0 1 1 0 1 0 0] [0 1 1 0 0 0 1 1 0 0] [0 1 0 1 0 0 1 0 1 1] [0 0 0 0 1 0 1 0 1 1] [1 0 1 0 0 1 0 1 0 1]]
- Parameters
nbqbits (int) – the number of qubits
- Returns
a linear operator
- Return type
np.ndarray
Note
This method is available as an application in Qaptiva Access.