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

Classes

class  DualBuilder
 

Functions

def _build_microcase_hamiltonian (term_specs)
 
def _build_microcase_hamiltonian_metadata (term_specs)
 
def _make_microcase (case_name, qbit_num, builder_fn, required_gate_family, required_noise_models, case_kind, purpose, term_specs)
 
def _pauli_string_matrix (pauli_string)
 
def build_1q_5ops_gates ()
 
def build_1q_5ops_mixed ()
 
def build_1q_u3_amplitude_damping_microcase ()
 
def build_1q_u3_local_depolarizing_microcase ()
 
def build_1q_u3_phase_damping_microcase ()
 
def build_2q_10ops_gates ()
 
def build_2q_10ops_mixed ()
 
def build_2q_5ops_gates ()
 
def build_2q_5ops_mixed ()
 
def build_2q_7ops_gates ()
 
def build_2q_7ops_mixed ()
 
def build_2q_u3_cnot_amplitude_damping_microcase ()
 
def build_2q_u3_cnot_local_depolarizing_microcase ()
 
def build_2q_u3_cnot_phase_damping_microcase ()
 
def build_3q_10ops_mixed ()
 
def build_3q_15ops_mixed ()
 
def build_3q_20ops_mixed ()
 
def build_3q_25ops_mixed ()
 
def build_3q_5ops_mixed ()
 
def build_3q_u3_cnot_mixed_local_noise_microcase ()
 
def build_4q_15ops_mixed ()
 
def build_4q_20ops_mixed ()
 
def build_4q_25ops_mixed ()
 
def build_5q_30ops_mixed ()
 

Variables

list ALL_CIRCUITS
 
list BENCHMARK_CIRCUITS
 
dictionary CIRCUITS_BY_QUBITS
 
list MANDATORY_MICROCASES
 
dictionary MANDATORY_MICROCASES_BY_QUBITS
 
dictionary PAULI_MATRICES
 

Detailed Description

Shared Test Circuits: SQUANDER vs Qiskit

Contains DualBuilder class and circuit factory functions for use in both
validation and benchmarking scripts.

Test circuits:
- 1 qubit: 5 mixed ops, 5 gates (no noise)
- 2 qubits: 5/7/10 mixed ops, 5/7/10 gates (no noise)
- 3 qubits: 5/10/15/20/25 mixed ops
- 4 qubits: 15/20/25 mixed ops
- 5 qubits: 30 mixed ops (commented out - slow with Qiskit)

Function Documentation

◆ _build_microcase_hamiltonian()

def circuits._build_microcase_hamiltonian (   term_specs)
private

Definition at line 617 of file circuits.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _build_microcase_hamiltonian_metadata()

def circuits._build_microcase_hamiltonian_metadata (   term_specs)
private

Definition at line 625 of file circuits.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _make_microcase()

def circuits._make_microcase (   case_name,
  qbit_num,
  builder_fn,
  required_gate_family,
  required_noise_models,
  case_kind,
  purpose,
  term_specs 
)
private

Definition at line 644 of file circuits.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _pauli_string_matrix()

def circuits._pauli_string_matrix (   pauli_string)
private

Definition at line 610 of file circuits.py.

Here is the caller graph for this function:

◆ build_1q_5ops_gates()

def circuits.build_1q_5ops_gates ( )
1 qubit, 5 gate operations (no noise).

Definition at line 185 of file circuits.py.

◆ build_1q_5ops_mixed()

def circuits.build_1q_5ops_mixed ( )
1 qubit, 5 mixed operations.

Definition at line 174 of file circuits.py.

◆ build_1q_u3_amplitude_damping_microcase()

def circuits.build_1q_u3_amplitude_damping_microcase ( )

Definition at line 665 of file circuits.py.

◆ build_1q_u3_local_depolarizing_microcase()

def circuits.build_1q_u3_local_depolarizing_microcase ( )

Definition at line 658 of file circuits.py.

◆ build_1q_u3_phase_damping_microcase()

def circuits.build_1q_u3_phase_damping_microcase ( )

Definition at line 672 of file circuits.py.

◆ build_2q_10ops_gates()

def circuits.build_2q_10ops_gates ( )
2 qubits, 10 gate operations (no noise).

Definition at line 270 of file circuits.py.

◆ build_2q_10ops_mixed()

def circuits.build_2q_10ops_mixed ( )
2 qubits, 10 mixed operations.

Definition at line 225 of file circuits.py.

◆ build_2q_5ops_gates()

def circuits.build_2q_5ops_gates ( )
2 qubits, 5 gate operations (no noise).

Definition at line 246 of file circuits.py.

◆ build_2q_5ops_mixed()

def circuits.build_2q_5ops_mixed ( )
2 qubits, 5 mixed operations.

Definition at line 201 of file circuits.py.

◆ build_2q_7ops_gates()

def circuits.build_2q_7ops_gates ( )
2 qubits, 7 gate operations (no noise).

Definition at line 257 of file circuits.py.

◆ build_2q_7ops_mixed()

def circuits.build_2q_7ops_mixed ( )
2 qubits, 7 mixed operations.

Definition at line 212 of file circuits.py.

◆ build_2q_u3_cnot_amplitude_damping_microcase()

def circuits.build_2q_u3_cnot_amplitude_damping_microcase ( )

Definition at line 688 of file circuits.py.

◆ build_2q_u3_cnot_local_depolarizing_microcase()

def circuits.build_2q_u3_cnot_local_depolarizing_microcase ( )

Definition at line 679 of file circuits.py.

◆ build_2q_u3_cnot_phase_damping_microcase()

def circuits.build_2q_u3_cnot_phase_damping_microcase ( )

Definition at line 697 of file circuits.py.

◆ build_3q_10ops_mixed()

def circuits.build_3q_10ops_mixed ( )
3 qubits, 10 mixed operations.

Definition at line 302 of file circuits.py.

◆ build_3q_15ops_mixed()

def circuits.build_3q_15ops_mixed ( )
3 qubits, 15 mixed operations.

Definition at line 318 of file circuits.py.

◆ build_3q_20ops_mixed()

def circuits.build_3q_20ops_mixed ( )
3 qubits, 20 mixed operations.

Definition at line 339 of file circuits.py.

◆ build_3q_25ops_mixed()

def circuits.build_3q_25ops_mixed ( )
3 qubits, 25 mixed operations.

Definition at line 365 of file circuits.py.

◆ build_3q_5ops_mixed()

def circuits.build_3q_5ops_mixed ( )
3 qubits, 5 mixed operations.

Definition at line 291 of file circuits.py.

◆ build_3q_u3_cnot_mixed_local_noise_microcase()

def circuits.build_3q_u3_cnot_mixed_local_noise_microcase ( )

Definition at line 706 of file circuits.py.

◆ build_4q_15ops_mixed()

def circuits.build_4q_15ops_mixed ( )
4 qubits, 15 mixed operations.

Definition at line 401 of file circuits.py.

◆ build_4q_20ops_mixed()

def circuits.build_4q_20ops_mixed ( )
4 qubits, 20 mixed operations.

Definition at line 422 of file circuits.py.

◆ build_4q_25ops_mixed()

def circuits.build_4q_25ops_mixed ( )
4 qubits, 25 mixed operations.

Definition at line 448 of file circuits.py.

◆ build_5q_30ops_mixed()

def circuits.build_5q_30ops_mixed ( )
5 qubits, 30 mixed operations.

Definition at line 484 of file circuits.py.

Variable Documentation

◆ ALL_CIRCUITS

list circuits.ALL_CIRCUITS
Initial value:
1 = [
2  ("1q/5ops mixed", build_1q_5ops_mixed),
3  ("1q/5ops gates", build_1q_5ops_gates),
4  ("2q/5ops mixed", build_2q_5ops_mixed),
5  ("2q/7ops mixed", build_2q_7ops_mixed),
6  ("2q/10ops mixed", build_2q_10ops_mixed),
7  ("2q/5ops gates", build_2q_5ops_gates),
8  ("2q/7ops gates", build_2q_7ops_gates),
9  ("2q/10ops gates", build_2q_10ops_gates),
10  ("3q/5ops mixed", build_3q_5ops_mixed),
11  ("3q/10ops mixed", build_3q_10ops_mixed),
12  ("3q/15ops mixed", build_3q_15ops_mixed),
13  ("3q/20ops mixed", build_3q_20ops_mixed),
14  ("3q/25ops mixed", build_3q_25ops_mixed),
15  ("4q/15ops mixed", build_4q_15ops_mixed),
16  ("4q/20ops mixed", build_4q_20ops_mixed),
17  ("4q/25ops mixed", build_4q_25ops_mixed),
18  (
19  "5q/30ops mixed",
20  build_5q_30ops_mixed,
21  ), # Slow with Qiskit but works with AerSimulator
22 ]

Definition at line 531 of file circuits.py.

◆ BENCHMARK_CIRCUITS

list circuits.BENCHMARK_CIRCUITS
Initial value:
1 = [
2  ("1q/5ops mixed", build_1q_5ops_mixed),
3  ("1q/5ops gates", build_1q_5ops_gates),
4  ("2q/5ops mixed", build_2q_5ops_mixed),
5  ("2q/10ops mixed", build_2q_10ops_mixed),
6  ("3q/10ops mixed", build_3q_10ops_mixed),
7  ("3q/25ops mixed", build_3q_25ops_mixed),
8  ("4q/15ops mixed", build_4q_15ops_mixed),
9  ("4q/25ops mixed", build_4q_25ops_mixed),
10  (
11  "5q/30ops mixed",
12  build_5q_30ops_mixed,
13  ), # Slow with Qiskit but works with AerSimulator
14 ]

Definition at line 555 of file circuits.py.

◆ CIRCUITS_BY_QUBITS

dictionary circuits.CIRCUITS_BY_QUBITS
Initial value:
1 = {
2  1: [
3  ("1q/5ops mixed", build_1q_5ops_mixed),
4  ("1q/5ops gates", build_1q_5ops_gates),
5  ],
6  2: [
7  ("2q/5ops mixed", build_2q_5ops_mixed),
8  ("2q/7ops mixed", build_2q_7ops_mixed),
9  ("2q/10ops mixed", build_2q_10ops_mixed),
10  ("2q/5ops gates", build_2q_5ops_gates),
11  ("2q/7ops gates", build_2q_7ops_gates),
12  ("2q/10ops gates", build_2q_10ops_gates),
13  ],
14  3: [
15  ("3q/5ops mixed", build_3q_5ops_mixed),
16  ("3q/10ops mixed", build_3q_10ops_mixed),
17  ("3q/15ops mixed", build_3q_15ops_mixed),
18  ("3q/20ops mixed", build_3q_20ops_mixed),
19  ("3q/25ops mixed", build_3q_25ops_mixed),
20  ],
21  4: [
22  ("4q/15ops mixed", build_4q_15ops_mixed),
23  ("4q/20ops mixed", build_4q_20ops_mixed),
24  ("4q/25ops mixed", build_4q_25ops_mixed),
25  ],
26  5: [ # Slow with Qiskit but works with AerSimulator
27  ("5q/30ops mixed", build_5q_30ops_mixed),
28  ],
29 }

Definition at line 571 of file circuits.py.

◆ MANDATORY_MICROCASES

list circuits.MANDATORY_MICROCASES

Definition at line 719 of file circuits.py.

◆ MANDATORY_MICROCASES_BY_QUBITS

dictionary circuits.MANDATORY_MICROCASES_BY_QUBITS
Initial value:
1 = {
2  qbit_num: [
3  case for case in MANDATORY_MICROCASES if case["qbit_num"] == qbit_num
4  ]
5  for qbit_num in sorted({case["qbit_num"] for case in MANDATORY_MICROCASES})
6 }

Definition at line 803 of file circuits.py.

◆ PAULI_MATRICES

dictionary circuits.PAULI_MATRICES
Initial value:
1 = {
2  "I": np.eye(2, dtype=complex),
3  "X": np.array([[0, 1], [1, 0]], dtype=complex),
4  "Y": np.array([[0, -1j], [1j, 0]], dtype=complex),
5  "Z": np.array([[1, 0], [0, -1]], dtype=complex),
6 }

Definition at line 602 of file circuits.py.