tket
|
Abstract class for a ZX generator. More...
#include <ZXGenerator.hpp>
Public Member Functions | |
ZXType | get_type () const |
virtual std::optional< QuantumType > | get_qtype () const =0 |
Return the quantum type of the generator, if it is definable. | |
virtual bool | valid_edge (std::optional< unsigned > port, QuantumType qtype) const =0 |
Returns whether or not an edge of a given QuantumType can validly be placed on the given port. | |
virtual SymSet | free_symbols () const =0 |
virtual ZXGen_ptr | symbol_substitution (const SymEngine::map_basic_basic &sub_map) const =0 |
Operation with values substituted for symbols. | |
virtual std::string | get_name (bool latex=false) const =0 |
Outputs a string-based description for the generator. | |
virtual bool | is_equal (const ZXGen &other) const |
Implementation of equivalence checking to eliminate ambiguous warnings for operator==. | |
bool | operator== (const ZXGen &other) const |
virtual | ~ZXGen () |
Static Public Member Functions | |
static ZXGen_ptr | create_gen (ZXType type, QuantumType qtype=QuantumType::Quantum) |
Generic constructors for obtaining generators with more generality than going via subtype constructors. | |
static ZXGen_ptr | create_gen (ZXType type, const Expr ¶m, QuantumType qtype=QuantumType::Quantum) |
static ZXGen_ptr | create_gen (ZXType type, bool param, QuantumType qtype=QuantumType::Quantum) |
Protected Member Functions | |
ZXGen (ZXType type) | |
ZXGen (Base class) implementation. | |
Protected Attributes | |
const ZXType | type_ |
Abstract class for a ZX generator.
Each ZXType has a single possible subclass that can realise it, allowing us to statically cast to a subclass once that is determined. Treatment of ports and QuantumType is handled by each subclass.
Definition at line 122 of file ZXGenerator.hpp.
|
virtual |
Definition at line 89 of file ZXGenerator.cpp.
|
protected |
ZXGen (Base class) implementation.
Definition at line 79 of file ZXGenerator.cpp.
|
static |
Definition at line 148 of file ZXGenerator.cpp.
|
static |
Definition at line 128 of file ZXGenerator.cpp.
|
static |
Generic constructors for obtaining generators with more generality than going via subtype constructors.
Definition at line 91 of file ZXGenerator.cpp.
|
pure virtual |
Implemented in tket::zx::BoundaryGen, tket::zx::PhasedGen, tket::zx::CliffordGen, tket::zx::DirectedGen, and tket::zx::ZXBox.
|
pure virtual |
Outputs a string-based description for the generator.
This should be enough to specify the generator exactly.
latex | whether the string should be formatted for LaTeX math mode or plaintext |
Implemented in tket::zx::BoundaryGen, tket::zx::PhasedGen, tket::zx::CliffordGen, tket::zx::DirectedGen, and tket::zx::ZXBox.
|
pure virtual |
Return the quantum type of the generator, if it is definable.
It may not be definable for directed generators that mix types of different ports, such as ZXBox.
What this means might be context dependent. Generally, we say that this is the expected quantum type of every incident edge. However, Classical BasicGen objects (spiders, HBox) can accept Quantum edges which are treated as a pair of edges.
Implemented in tket::zx::BoundaryGen, tket::zx::BasicGen, tket::zx::DirectedGen, and tket::zx::ZXBox.
ZXType tket::zx::ZXGen::get_type | ( | ) | const |
Definition at line 81 of file ZXGenerator.cpp.
|
virtual |
Implementation of equivalence checking to eliminate ambiguous warnings for operator==.
Assumes other matches the ZXType of this, so it is safe to cast.
Reimplemented in tket::zx::BoundaryGen, tket::zx::BasicGen, tket::zx::PhasedGen, tket::zx::CliffordGen, tket::zx::DirectedGen, and tket::zx::ZXBox.
Definition at line 87 of file ZXGenerator.cpp.
bool tket::zx::ZXGen::operator== | ( | const ZXGen & | other | ) | const |
Definition at line 83 of file ZXGenerator.cpp.
|
pure virtual |
Operation with values substituted for symbols.
sub_map | map from symbols to values |
Implemented in tket::zx::BoundaryGen, tket::zx::PhasedGen, tket::zx::CliffordGen, tket::zx::DirectedGen, and tket::zx::ZXBox.
|
pure virtual |
Returns whether or not an edge of a given QuantumType can validly be placed on the given port.
Implemented in tket::zx::BoundaryGen, tket::zx::BasicGen, tket::zx::DirectedGen, and tket::zx::ZXBox.
|
protected |
Definition at line 193 of file ZXGenerator.hpp.