Reference: Matrix Qubricks¶
Contents¶
Matrix Class¶
psiqworkbench.qubricks.qbk_matrix.Matrix ¶
Bases: Qubrick
Qubrick for injecting arbitrary matrices into a QPU.
compute ¶
Apply matrix to the target_qubits register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix
|
ndarray
|
Matrix to be applied to the quantum state.
If |
required |
target_qubits
|
Qubits
|
Qubits to apply |
required |
condition_qubits
|
Qubits
|
Qubits |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the first dimension of |
Note
For more details, see Built-in Qubricks tutorial.
DiagonalMatrix Class¶
psiqworkbench.qubricks.qbk_matrix.DiagonalMatrix ¶
Bases: Qubrick
compute ¶
Apply matrix_diagonal to the target_qubits register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix_diagonal
|
ndarray
|
Diagonal of the matrix to be applied to the quantum state.
If |
required |
target_qubits
|
Qubits
|
Qubits to apply |
required |
ctrl
|
Qubits
|
Qubits |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the length of |