tket
|
Pauli graph structure for GreedyPauliSimp. More...
#include <GreedyPauliOptimisation.hpp>
Public Member Functions | |
GPGraph (qubit_vector_t qubits, bit_vector_t bits) | |
Construct an GPGraph from the qubits and bits. | |
GPVertSet | get_successors (const GPVert &vert) const |
GPVertSet | get_predecessors (const GPVert &vert) const |
std::vector< GPVert > | vertices_in_order () const |
All vertices of the DAG, topologically sorted. | |
std::tuple< std::vector< std::vector< PauliNode_ptr > >, std::vector< PauliNode_ptr >, boost::bimap< unsigned, unsigned > > | get_sequence (std::shared_ptr< std::atomic< bool > > stop_flag) |
void | apply_gate_at_end (const Command &cmd, bool conditional=false, std::vector< unsigned > cond_bits={}, unsigned cond_value=0) |
Applies the given gate to the end of the graph. | |
Pauli graph structure for GreedyPauliSimp.
A DAG is used to store all operations except for the end-of-circuit Clifford and end-of-circuit measurements. The vertices consist of Pauli rotations, mid-circuit measurements, resets, conditional Pauli rotations, and classical operations. Edges represent gate dependencies, where two nodes commute if they commute on both quantum and classical wires.
End-of-circuit measurements are stored as a map from integers to integers. These measurements are kept separate (i.e., after the final Clifford) so optimisation around them can later be handled by CliffordPushThroughMeasures
.
The final Clifford operator is stored using a UnitaryRevTableau
. Note that UnitaryRevTableau
is chosen over PauliPropagations
due to the availability of existing update methods.
Definition at line 526 of file GreedyPauliOptimisation.hpp.
tket::Transforms::GreedyPauliSimp::GPGraph::GPGraph | ( | qubit_vector_t | qubits, |
bit_vector_t | bits | ||
) |
Construct an GPGraph from the qubits and bits.
Definition at line 115 of file GreedyPauliConverters.cpp.
void tket::Transforms::GreedyPauliSimp::GPGraph::apply_gate_at_end | ( | const Command & | cmd, |
bool | conditional = false , |
||
std::vector< unsigned > | cond_bits = {} , |
||
unsigned | cond_value = 0 |
||
) |
Applies the given gate to the end of the graph.
Clifford gates transform the tableau. Non-Clifford gates and conditional Clifford gates are transformed into PauliNodes by the tableau and added to the graph.
Definition at line 271 of file GreedyPauliConverters.cpp.
Definition at line 137 of file GreedyPauliConverters.cpp.
std::tuple< std::vector< std::vector< PauliNode_ptr > >, std::vector< PauliNode_ptr >, boost::bimap< unsigned, unsigned > > tket::Transforms::GreedyPauliSimp::GPGraph::get_sequence | ( | std::shared_ptr< std::atomic< bool > > | stop_flag | ) |
Definition at line 485 of file GreedyPauliConverters.cpp.
Definition at line 128 of file GreedyPauliConverters.cpp.
std::vector< GPVert > tket::Transforms::GreedyPauliSimp::GPGraph::vertices_in_order | ( | ) | const |
All vertices of the DAG, topologically sorted.
This method is "morally" const, but it sets the vertex indices in the DAG.
Definition at line 472 of file GreedyPauliConverters.cpp.