mqt.qecc.cococo.internal_testing¶
Helper functions to perform testing.
Functions¶
|
Extracts the gates from the schedule in the order of the schedule. ignore 'idle' moves in the vdp dict. |
|
Extracts the gates with the qubit labels (not the positions of quibts) by respecting the changing layout dictionaries. |
|
Check that the input terminal_pairs has the same number of gates as the resulting schedule. |
|
Creates some random circuit in stim for a random initial state. |
|
Only works for circuits and the standard scheme, i.e. find_total_vdp_layers_dyn. |
|
Checks order of the schedule. |
|
Checks whether there are duplicate nodes in the paths of one layer. |
|
Checks whether there are duplicate nodes in the paths of one layer. |
|
Checks whether the path occupies any logical pos somewhere else than on the end points. this would be an issue! |
|
Checks whether a path / tree occupies any logical pos somewhere else than at the end points. |
|
Checks whether the t timestamps make sense in a finished schedule (opt). |
|
Checks whether the t timestamps make sense in a finished vdp layeyrs (st). |
Module Contents¶
- extract_gates_schedule(schedule: Any) Sequence[mqt.qecc.cococo.types.pos | tuple[mqt.qecc.cococo.types.pos, mqt.qecc.cococo.types.pos]][source]¶
Extracts the gates from the schedule in the order of the schedule. ignore ‘idle’ moves in the vdp dict.
- extract_gates_schedule_respect_layout(schedule: Any) Sequence[mqt.qecc.cococo.types.pos | tuple[mqt.qecc.cococo.types.pos, mqt.qecc.cococo.types.pos]][source]¶
Extracts the gates with the qubit labels (not the positions of quibts) by respecting the changing layout dictionaries.
- check_num_gates(terminal_pairs: Sequence[mqt.qecc.cococo.types.pos | tuple[mqt.qecc.cococo.types.pos, mqt.qecc.cococo.types.pos]], schedule: Any) bool[source]¶
Check that the input terminal_pairs has the same number of gates as the resulting schedule.
- random_initial_state(n_qubits: int) stim.Circuit[source]¶
Creates some random circuit in stim for a random initial state.
- check_order_dyn_gates_st(terminal_pairs: Sequence[mqt.qecc.cococo.types.pos | tuple[mqt.qecc.cococo.types.pos, mqt.qecc.cococo.types.pos]], vdp_layers: list[mqt.qecc.cococo.types.VdpDict], layout: dict[int, mqt.qecc.cococo.types.pos] | None = None) bool[source]¶
Only works for circuits and the standard scheme, i.e. find_total_vdp_layers_dyn.
Includes both CNOT and T gates in a circuit.
- check_order_dyn_gates(terminal_pairs: Sequence[mqt.qecc.cococo.types.pos | tuple[mqt.qecc.cococo.types.pos, mqt.qecc.cococo.types.pos]], schedule: Any) bool[source]¶
Checks order of the schedule.
simulates the gate order in the schedule (changed from pushing) and from initial terminal pairs on a random initial state. the results must coincide to make sure that the pushing is performed correctly.
- check_duplicate_nodes_per_layer_st(vdp_layers: list[mqt.qecc.cococo.types.VdpDict]) bool[source]¶
Checks whether there are duplicate nodes in the paths of one layer.
this would indicate that there are overlapping paths and is a big problem.
- check_duplicate_nodes_per_layer(schedule: Any) bool[source]¶
Checks whether there are duplicate nodes in the paths of one layer.
this would indicate that there are overlapping paths and is a big problem.
- check_path_on_logical_st(vdp_layers: list[mqt.qecc.cococo.types.VdpDict], logical_pos: list[mqt.qecc.cococo.types.pos]) bool[source]¶
Checks whether the path occupies any logical pos somewhere else than on the end points. this would be an issue!
- check_path_on_logical(schedule: Any) bool[source]¶
Checks whether a path / tree occupies any logical pos somewhere else than at the end points.