# Path: qflexcirq/circuits/generator.py
# class Device:
# class Cycle:
# class Circuit:
# class PseudoRandomGateGenerator(Iterator[str]):
# class PseudoRandomCircuitGenerator:
#     def __init__(self,
#                  interaction_patterns: Dict[str, Set[Tuple[int, int]]]) -> None:
#     def pattern_names(self) -> Set[str]:
#     def pattern(self, name: str) -> Set[Tuple[int, int]]:
#     def __init__(self) -> None:
#     def active_qubits(self) -> Set[int]:
#     def append(self, gate: Gate) -> 'Cycle':
#     def to_qsim_lines(self) -> Sequence[str]:
#         def gate_to_qsim_line(gate: Gate) -> str:
#     def __init__(self) -> None:
#     def append(self, cycle: Cycle) -> None:
#     def to_qsim_lines(self) -> Sequence[str]:
#     def save_as_qsim(self, filename: str):
#     def __init__(self, valid_gates: Sequence[str]) -> None:
#     def __next__(self) -> str:
#     def __init__(self, device: Device, single_qubit_gates: Sequence[str],
#                  two_qubit_gate: str) -> None:
#     def _generate_local_operations_cycle(
#             self, prggs: Sequence[PseudoRandomGateGenerator]) -> Cycle:
#     def _generate_interaction_cycle(self, pattern_name: str) -> Cycle:
#     def generate(self, sequence: str, depth: int, seed: int) -> Circuit:
# def main(args):


from typing import Dict, Set, Tuple
from qflexcirq.circuits import generator
import sys
    """Returns degree of vertex."""
    return len(edges[vertex])


def test_graphs():
    """Verify all devices have the correct number of qubits with each degree."""
    test_edges = compute_edges(TestDevice._interaction_patterns)
    assert degree(test_edges, 0) == 2
    assert degree(test_edges, 1) == 2
    assert degree(test_edges, 2) == 2

    aspen_edges = compute_edges(Aspen._interaction_patterns)
    for qubit in range(16):
        if qubit in {1, 2, 13, 14}:
            assert degree(aspen_edges, qubit) == 3
        else:
            assert degree(aspen_edges, qubit) == 2

    rochester_edges = compute_edges(Rochester._interaction_patterns)
    for qubit in range(53):
        if qubit in {51, 52}:
            assert degree(rochester_edges, qubit) == 1
        elif qubit in {9, 11, 13, 21, 23, 25, 32, 34, 36, 44, 46, 48}:
            assert degree(rochester_edges, qubit) == 3
        else:
            assert degree(rochester_edges, qubit) == 2


def test_qsim_output():
    """Verify qsim output."""

# Path: qflexcirq/circuits/generator.py
# class Device:
# class Cycle:
# class Circuit:
# class PseudoRandomGateGenerator(Iterator[str]):
# class PseudoRandomCircuitGenerator:
#     def __init__(self,
#                  interaction_patterns: Dict[str, Set[Tuple[int, int]]]) -> None:
#     def pattern_names(self) -> Set[str]:
#     def pattern(self, name: str) -> Set[Tuple[int, int]]:
#     def __init__(self) -> None:
#     def active_qubits(self) -> Set[int]:
#     def append(self, gate: Gate) -> 'Cycle':
#     def to_qsim_lines(self) -> Sequence[str]:
#         def gate_to_qsim_line(gate: Gate) -> str:
#     def __init__(self) -> None:
#     def append(self, cycle: Cycle) -> None:
#     def to_qsim_lines(self) -> Sequence[str]:
#     def save_as_qsim(self, filename: str):
#     def __init__(self, valid_gates: Sequence[str]) -> None:
#     def __next__(self) -> str:
#     def __init__(self, device: Device, single_qubit_gates: Sequence[str],
#                  two_qubit_gate: str) -> None:
#     def _generate_local_operations_cycle(
#             self, prggs: Sequence[PseudoRandomGateGenerator]) -> Cycle:
#     def _generate_interaction_cycle(self, pattern_name: str) -> Cycle:
#     def generate(self, sequence: str, depth: int, seed: int) -> Circuit:
# def main(args):


# Path: tests/python/generator_test.py
from typing import Dict, Set, Tuple
from qflexcirq.circuits import generator
import sys

    """Returns degree of vertex."""
    return len(edges[vertex])


def test_graphs():
    """Verify all devices have the correct number of qubits with each degree."""
    test_edges = compute_edges(TestDevice._interaction_patterns)
    assert degree(test_edges, 0) == 2
    assert degree(test_edges, 1) == 2
    assert degree(test_edges, 2) == 2

    aspen_edges = compute_edges(Aspen._interaction_patterns)
    for qubit in range(16):
        if qubit in {1, 2, 13, 14}:
            assert degree(aspen_edges, qubit) == 3
        else:
            assert degree(aspen_edges, qubit) == 2

    rochester_edges = compute_edges(Rochester._interaction_patterns)
    for qubit in range(53):
        if qubit in {51, 52}:
            assert degree(rochester_edges, qubit) == 1
        elif qubit in {9, 11, 13, 21, 23, 25, 32, 34, 36, 44, 46, 48}:
            assert degree(rochester_edges, qubit) == 3
        else:
            assert degree(rochester_edges, qubit) == 2


def test_qsim_output():
    """Verify qsim output."""

    circuit = generator.Circuit()