Class that you can inherit from to make your own unitary gate converter for use within DQCsim.
More...
|
template<class Unbound , class Bound > |
class | GateMap |
|
Class that you can inherit from to make your own unitary gate converter for use within DQCsim.
Definition at line 4606 of file dqcsim.
◆ detect()
virtual bool dqcsim::wrap::CustomUnitaryGateConverter::detect |
( |
Matrix && |
matrix, |
|
|
ssize_t |
num_controls, |
|
|
ArbData & |
params |
|
) |
| const |
|
inlinevirtual |
The to-be-implemented detector function.
- Parameters
-
matrix | The matrix to match. |
num_controls | The number of control qubits associated with the matrix; these qubits are implicit in the matrix. That is, to get the full matrix, you need to expand the given matrix with this many qubits. |
params | If 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::exception | When 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 4688 of file dqcsim.
◆ construct()
virtual Matrix dqcsim::wrap::CustomUnitaryGateConverter::construct |
( |
ArbData & |
params, |
|
|
ssize_t & |
num_controls |
|
) |
| const |
|
inlinevirtual |
The to-be-implemented constructor function.
- Parameters
-
params | The parameters for the gate. Anything left in here is attached to the gate. |
num_controls | If this gate only accepts a specific number of control qubits during construction, write the expected amount here. Assigning a negative number or not assigning it means there is no constraint. |
- Returns
- The constructed matrix.
- Exceptions
-
std::exception | When 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 4708 of file dqcsim.
The documentation for this class was generated from the following file: