Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Classes | Functions | Variables
tests.gates.test_gates Namespace Reference

Classes

class  TestGateDerivativeFiniteDifference
 
class  TestGates
 
class  TestGateScalarPaths
 

Functions

def _add_gate_to_qiskit (circuit, gate_name, parameters)
 
def _apply_from_right_with_precision (gate_obj, matrix, parameters, is_f32)
 
def _apply_gate (gate_obj, state, parameters, is_f32=False, parallel=0)
 
def _apply_to_matrix_with_precision (gate_obj, matrix, parameters, is_f32)
 
def _apply_to_state_with_precision (gate_obj, state, parameters, is_f32)
 
def _assert_matrices_close (a, b, tol=1e-8)
 
def _discover_gate_names ()
 
def _discover_multi_qubit_gate_names ()
 
def _discover_parameterized_gate_names ()
 
def _gate_matrix (gate_obj, parameters)
 
def _get_matrix_with_precision (gate_obj, parameters, is_f32)
 
def _instantiate_gate (gate_name, qbit_num=4)
 
def _parameters_for_gate (gate_obj, dtype=np.float64)
 

Variables

 ALL_GATE_NAMES
 
 DERIVATIVE_GATE_NAMES
 
 DERIVATIVE_TEST_EXCLUDED_GATES
 
 F32_TOL
 
 FORBIDDEN_MULTI_QUBIT_GATES_IN_CNOT_BASIS
 
 MULTI_QUBIT_GATE_NAMES
 
 NATIVE_UNSAFE_APPLY_GATES
 
 NATIVE_UNSAFE_MATRIX_GATES
 
 QISKIT_EXCLUDED_GATES
 
 QISKIT_MATRIX_UNSUPPORTED
 
 RECT_COLS_MAX
 

Detailed Description

Copyright 2020 Peter Rakyta, Ph.D.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.

Function Documentation

◆ _add_gate_to_qiskit()

def tests.gates.test_gates._add_gate_to_qiskit (   circuit,
  gate_name,
  parameters 
)
private

Definition at line 162 of file test_gates.py.

Here is the caller graph for this function:

◆ _apply_from_right_with_precision()

def tests.gates.test_gates._apply_from_right_with_precision (   gate_obj,
  matrix,
  parameters,
  is_f32 
)
private

Definition at line 145 of file test_gates.py.

Here is the caller graph for this function:

◆ _apply_gate()

def tests.gates.test_gates._apply_gate (   gate_obj,
  state,
  parameters,
  is_f32 = False,
  parallel = 0 
)
private

Definition at line 114 of file test_gates.py.

◆ _apply_to_matrix_with_precision()

def tests.gates.test_gates._apply_to_matrix_with_precision (   gate_obj,
  matrix,
  parameters,
  is_f32 
)
private

Definition at line 136 of file test_gates.py.

Here is the caller graph for this function:

◆ _apply_to_state_with_precision()

def tests.gates.test_gates._apply_to_state_with_precision (   gate_obj,
  state,
  parameters,
  is_f32 
)
private

Definition at line 127 of file test_gates.py.

Here is the caller graph for this function:

◆ _assert_matrices_close()

def tests.gates.test_gates._assert_matrices_close (   a,
  b,
  tol = 1e-8 
)
private

Definition at line 154 of file test_gates.py.

Here is the caller graph for this function:

◆ _discover_gate_names()

def tests.gates.test_gates._discover_gate_names ( )
private

Definition at line 35 of file test_gates.py.

◆ _discover_multi_qubit_gate_names()

def tests.gates.test_gates._discover_multi_qubit_gate_names ( )
private

Definition at line 72 of file test_gates.py.

Here is the call graph for this function:

◆ _discover_parameterized_gate_names()

def tests.gates.test_gates._discover_parameterized_gate_names ( )
private

Definition at line 61 of file test_gates.py.

Here is the call graph for this function:

◆ _gate_matrix()

def tests.gates.test_gates._gate_matrix (   gate_obj,
  parameters 
)
private

Definition at line 108 of file test_gates.py.

Here is the caller graph for this function:

◆ _get_matrix_with_precision()

def tests.gates.test_gates._get_matrix_with_precision (   gate_obj,
  parameters,
  is_f32 
)
private

Definition at line 121 of file test_gates.py.

Here is the caller graph for this function:

◆ _instantiate_gate()

def tests.gates.test_gates._instantiate_gate (   gate_name,
  qbit_num = 4 
)
private

Definition at line 83 of file test_gates.py.

Here is the caller graph for this function:

◆ _parameters_for_gate()

def tests.gates.test_gates._parameters_for_gate (   gate_obj,
  dtype = np.float64 
)
private

Definition at line 101 of file test_gates.py.

Here is the caller graph for this function:

Variable Documentation

◆ ALL_GATE_NAMES

tests.gates.test_gates.ALL_GATE_NAMES

Definition at line 51 of file test_gates.py.

◆ DERIVATIVE_GATE_NAMES

tests.gates.test_gates.DERIVATIVE_GATE_NAMES

Definition at line 213 of file test_gates.py.

◆ DERIVATIVE_TEST_EXCLUDED_GATES

tests.gates.test_gates.DERIVATIVE_TEST_EXCLUDED_GATES

Definition at line 56 of file test_gates.py.

◆ F32_TOL

tests.gates.test_gates.F32_TOL

Definition at line 58 of file test_gates.py.

◆ FORBIDDEN_MULTI_QUBIT_GATES_IN_CNOT_BASIS

tests.gates.test_gates.FORBIDDEN_MULTI_QUBIT_GATES_IN_CNOT_BASIS

Definition at line 214 of file test_gates.py.

◆ MULTI_QUBIT_GATE_NAMES

tests.gates.test_gates.MULTI_QUBIT_GATE_NAMES

Definition at line 212 of file test_gates.py.

◆ NATIVE_UNSAFE_APPLY_GATES

tests.gates.test_gates.NATIVE_UNSAFE_APPLY_GATES

Definition at line 55 of file test_gates.py.

◆ NATIVE_UNSAFE_MATRIX_GATES

tests.gates.test_gates.NATIVE_UNSAFE_MATRIX_GATES

Definition at line 54 of file test_gates.py.

◆ QISKIT_EXCLUDED_GATES

tests.gates.test_gates.QISKIT_EXCLUDED_GATES

Definition at line 52 of file test_gates.py.

◆ QISKIT_MATRIX_UNSUPPORTED

tests.gates.test_gates.QISKIT_MATRIX_UNSUPPORTED

Definition at line 53 of file test_gates.py.

◆ RECT_COLS_MAX

tests.gates.test_gates.RECT_COLS_MAX

Definition at line 57 of file test_gates.py.