DQCsim
Public Member Functions | Friends | List of all members
dqcsim::wrap::CustomGateConverter Class Reference

Class that you can inherit from to make your own custom gate converter for use within DQCsim. More...

Public Member Functions

virtual bool detect (Gate &&gate, QubitSet &qubits, ArbData &params) const
 The to-be-implemented detector function. More...
 
virtual Gate construct (QubitSet &&qubits, ArbData &&params) const
 The to-be-implemented constructor function. More...
 

Friends

template<class Unbound , class Bound >
class GateMap
 

Detailed Description

Class that you can inherit from to make your own custom gate converter for use within DQCsim.

Definition at line 4498 of file dqcsim.

Member Function Documentation

◆ detect()

virtual bool dqcsim::wrap::CustomGateConverter::detect ( Gate &&  gate,
QubitSet qubits,
ArbData params 
) const
inlinevirtual

The to-be-implemented detector function.

Parameters
gateThe gate to match.
qubitsIf the gate matches, its qubit arguments should be pushed into or assigned to this set. The set is initially empty.
paramsIf the gate matches, its parameters should be pushed into or assigned to this ArbData. This data object is initially a copy of the incoming gate's ArbData attachment.
Returns
Whether the incoming gate matches.
Exceptions
std::exceptionWhen an exception is thrown, its what() is returned to the user immediately. That is, any remaining detectors are not called.

The default implementation simply returns false, i.e. it never matches.

Definition at line 4580 of file dqcsim.

◆ construct()

virtual Gate dqcsim::wrap::CustomGateConverter::construct ( QubitSet &&  qubits,
ArbData &&  params 
) const
inlinevirtual

The to-be-implemented constructor function.

Parameters
qubitsThe qubit arguments for the gate.
paramsThe parameters for the gate.
Returns
The constructed gate.
Exceptions
std::exceptionWhen an exception is thrown, its what() is returned to the user.

The default implementation throws an exception indicating that no constructor is defined.

Definition at line 4596 of file dqcsim.


The documentation for this class was generated from the following file: