Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
List of all members | Public Member Functions
tests.gates.test_circuit.TestApplyFromRight Class Reference

Public Member Functions

def test_apply_from_right_f32_close_to_f64 (self, qbit_num)
 
def test_apply_from_right_mutates_matrix (self, qbit_num)
 
def test_apply_from_right_single_gate_f64 (self, qbit_num)
 
def test_apply_from_right_single_gate_noparams_f64 (self, qbit_num)
 

Detailed Description

apply_from_right: both f64 and f32.

Gates_block::apply_from_right iterates gates in forward order but reads
the parameter array from the END backward (by design for gradient
computations).  For a SINGLE-GATE circuit there is no ordering ambiguity,
so we can verify the result against the matrix; for multi-gate circuits we
verify f32/f64 consistency and that the matrix is actually mutated.

Definition at line 239 of file test_circuit.py.

Member Function Documentation

◆ test_apply_from_right_f32_close_to_f64()

def tests.gates.test_circuit.TestApplyFromRight.test_apply_from_right_f32_close_to_f64 (   self,
  qbit_num 
)
float32 apply_from_right result should match float64 reference.

Definition at line 295 of file test_circuit.py.

Here is the call graph for this function:

◆ test_apply_from_right_mutates_matrix()

def tests.gates.test_circuit.TestApplyFromRight.test_apply_from_right_mutates_matrix (   self,
  qbit_num 
)
apply_from_right must modify the input matrix in-place.

Definition at line 280 of file test_circuit.py.

Here is the call graph for this function:

◆ test_apply_from_right_single_gate_f64()

def tests.gates.test_circuit.TestApplyFromRight.test_apply_from_right_single_gate_f64 (   self,
  qbit_num 
)
For a single-gate circuit apply_from_right(params, I) == U.

Definition at line 250 of file test_circuit.py.

Here is the call graph for this function:

◆ test_apply_from_right_single_gate_noparams_f64()

def tests.gates.test_circuit.TestApplyFromRight.test_apply_from_right_single_gate_noparams_f64 (   self,
  qbit_num 
)
Single parameter-free gate (H): apply_from_right([], A) == A @ H.

Definition at line 265 of file test_circuit.py.

Here is the call graph for this function:

The documentation for this class was generated from the following file: