26 :
std::logic_error(message) {}
63 bool is_equal(
const Op &op_other)
const override;
79 const SymEngine::map_basic_basic &sub_map)
const override;
118 bool is_equal(
const Op &op_other)
const override;
122 return std::make_pair(paulis0_.
string, paulis1_.
string);
127 return std::make_pair(paulis0_.
coeff, paulis1_.
coeff);
138 const SymEngine::map_basic_basic &sub_map)
const override;
156 const std::vector<SymPauliTensor> &pauli_gadgets,
180 bool is_equal(
const Op &op_other)
const override;
193 const SymEngine::map_basic_basic &sub_map)
const override;
203 std::vector<SymPauliTensor> pauli_gadgets_;
210 const std::vector<SymPauliTensor> &pauli_gadgets,
217 double depth_weight = 0.3);
238 bool is_equal(
const Op &op_other)
const override;
266 const SymEngine::map_basic_basic &sub_map)
const override;
276 std::vector<SymPauliTensor> pauli_gadgets_;
281 double depth_weight_;
323 Circuit &circ,
const std::list<SpSymPauliTensor> &gadgets,
Abstract class for an operation from which a circuit can be extracted.
Abstract class representing an operation type.
PauliExpBoxInvalidity(const std::string &message)
Operation defined as the exponential of a tensor of Pauli operators.
void generate_circuit() const override
PauliExpBox()
Construct from the empty vector.
Expr get_phase() const
Get the phase parameter.
CXConfigType get_cx_config() const
Get the cx_config parameter (affects box decomposition)
Op_ptr symbol_substitution(const SymEngine::map_basic_basic &sub_map) const override
Operation with values for symbols substituted.
Op_ptr transpose() const override
Transpose of a unitary operation.
bool is_clifford() const override
Test whether operation is in the Clifford group.
static Op_ptr from_json(const nlohmann::json &j)
bool is_equal(const Op &op_other) const override
Equality check between two PauliExpBox instances.
~PauliExpBox() override=default
SymSet free_symbols() const override
Set of all free symbols occurring in operation parameters.
std::vector< Pauli > get_paulis() const
Get the Pauli string.
Op_ptr dagger() const override
Inverse (of a unitary operation)
static nlohmann::json to_json(const Op_ptr &op)
Op_ptr transpose() const override
Transpose of a unitary operation.
SymSet free_symbols() const override
Set of all free symbols occurring in operation parameters.
static Op_ptr from_json(const nlohmann::json &j)
auto get_cx_config() const
Get the cx_config parameter (affects box decomposition)
bool is_equal(const Op &op_other) const override
Equality check between two instances.
PauliExpCommutingSetBox()
Construct from the empty vector.
static nlohmann::json to_json(const Op_ptr &op)
~PauliExpCommutingSetBox() override
Op_ptr dagger() const override
Inverse (of a unitary operation)
bool is_clifford() const override
Test whether operation is in the Clifford group.
bool paulis_commute() const
auto get_pauli_gadgets() const
Get the pauli gadgets.
void generate_circuit() const override
Op_ptr symbol_substitution(const SymEngine::map_basic_basic &sub_map) const override
Operation with values for symbols substituted.
std::pair< std::vector< Pauli >, std::vector< Pauli > > get_paulis_pair() const
Get Pauli strings for the pair.
bool is_clifford() const override
Test whether operation is in the Clifford group.
SymSet free_symbols() const override
Set of all free symbols occurring in operation parameters.
bool is_equal(const Op &op_other) const override
Equality check between two instances.
Op_ptr transpose() const override
Transpose of a unitary operation.
CXConfigType get_cx_config() const
Get the cx_config parameter (affects box decomposition)
Op_ptr dagger() const override
Inverse (of a unitary operation)
Op_ptr symbol_substitution(const SymEngine::map_basic_basic &sub_map) const override
Operation with values for symbols substituted.
static Op_ptr from_json(const nlohmann::json &j)
void generate_circuit() const override
~PauliExpPairBox() override
static nlohmann::json to_json(const Op_ptr &op)
std::pair< Expr, Expr > get_phase_pair() const
Get phase parameters for the pair.
PauliExpPairBox()
Construct from the empty vector.
SymSet free_symbols() const override
Set of all free symbols occurring in operation parameters.
double get_depth_weight() const
Tuning parameter for depth optimisation, only applies to PauliPartitionStrat::Greedy.
~TermSequenceBox() override
Transforms::PauliSynthStrat get_synth_strategy() const
Get the circuit synthesis strategy parameter (affects box decomposition)
PauliPartitionStrat get_partition_strategy() const
Get the pauli partitioning strategy parameter (affects box decomposition)
void generate_circuit() const override
bool is_equal(const Op &op_other) const override
Equality check between two instances.
static Op_ptr from_json(const nlohmann::json &j)
GraphColourMethod get_graph_colouring() const
Get the graph colouring parameter (affects box decomposition)
Op_ptr dagger() const override
Inverse (of a unitary operation)
static nlohmann::json to_json(const Op_ptr &op)
std::vector< SymPauliTensor > get_pauli_gadgets() const
Get the pauli gadgets.
bool is_clifford() const override
Test whether operation is in the Clifford group.
TermSequenceBox()
Construct from the empty vector.
Op_ptr symbol_substitution(const SymEngine::map_basic_basic &sub_map) const override
Operation with values for symbols substituted.
Op_ptr transpose() const override
Transpose of a unitary operation.
CXConfigType get_cx_config() const
Get the cx config parameter (affects box decomposition)
Defines tket::DeviceCharacterisation, used in NoiseAwarePlacement and in commute_SQ_gates_through_SWA...
void append_pauli_gadget_pair_as_box(Circuit &circ, const SpSymPauliTensor &pauli0, const SpSymPauliTensor &pauli1, CXConfigType cx_config)
Constructs a PauliExpPairBox for a pair of pauli gadgets and appends it to a circuit.
void append_single_pauli_gadget_as_pauli_exp_box(Circuit &circ, const SpSymPauliTensor &pauli, CXConfigType cx_config)
Constructs a PauliExpBox for a single pauli gadget and appends it to a circuit.
PauliPartitionStrat
A choice of strategies to partition Pauli tensors into sets.
@ CommutingSets
Sets of mutually commuting tensors; requires O(n^2) CXs for diagonalisation.
CXConfigType
Whenever a decomposition choice of Pauli gadgets is presented, users may use either Snake (a....
GraphColourMethod
A choice of methods to perform graph colouring for Pauli partitioning.
@ Lazy
Lazy: does not build the graph before performing the colouring; partitions while iterating through th...
void append_commuting_pauli_gadget_set_as_box(Circuit &circ, const std::list< SpSymPauliTensor > &gadgets, CXConfigType cx_config)
Constructs a PauliExpCommutingSetBox for a set of mutually commuting pauli gadgets and appends it to ...
SymEngine::Expression Expr
Representation of a phase as a multiple of .
std::shared_ptr< const Op > Op_ptr
PauliTensor< QubitPauliMap, Expr > SpSymPauliTensor
std::set< Sym, SymCompareLess > SymSet