Pattern¶
graphqomb.pattern module¶
Pattern module.
This module provides:
Pattern: Pattern classis_runnable: Check if the pattern is runnableprint_pattern: Print a pattern
Pattern Classes¶
- class graphqomb.pattern.Pattern[source]¶
Pattern class.
- pauli_frame¶
Pauli frame of the pattern to track the Pauli state of each node
- Type:
- property max_space: int[source]¶
Maximum number of qubits prepared at any point in the pattern.
- Returns:
Maximum number of qubits prepared at any point in the pattern
- Return type:
- property depth: int¶
Depth of the pattern (number of TICK commands).
- Returns:
Depth of the pattern
- Return type:
- property coordinates: dict[int, tuple[float, ...]]¶
Get all node coordinates from N commands and input coordinates.
- property active_volume: int¶
Calculate tha active volume, summation of space for each timeslice.
- Returns:
Active volume of the pattern
- Return type:
- property volume: int¶
Calculate the volume, defined as max_space * depth.
- Returns:
Volume of the pattern
- Return type:
- property throughput: float¶
Calculate the number of measurements per TICK in the pattern.
- Returns:
Number of measurements per TICK
- Return type:
- Raises:
ValueError – If the pattern has zero depth (no TICK commands)
- __init__(input_node_indices, output_node_indices, commands, pauli_frame, input_coordinates=<factory>)¶
Helper Functions¶
- graphqomb.pattern.is_runnable(pattern)[source]¶
Check if the pattern is runnable.
- Parameters:
pattern (
Pattern) – Pattern to check
- graphqomb.pattern.print_pattern(pattern, *, file=None, lim=40, cmd_filter=None)[source]¶
Print a pattern.
- Parameters:
pattern (
Pattern) – Pattern to printfile (
typing.TextIO, optional) – File to print to, by default None (prints to stdout)lim (
int, optional) – Maximum number of commands to print, by default 40cmd_filter (
typing.Callable[[Command],Command|None] |None, optional) – Command filter, by default None