We assumed all controlled gates to be controlling on the |1> state. It can be useful to also support controlled gates on the |0> state, like the CX[0](q_0, q_1) gate on the left.
q_0: ──o────■──
┌─┴─┐┌─┴─┐
q_1: ┤ X ├┤ X ├
└───┘└───┘
To support them, I am thinking to add a class GeneralControlledGate : public Gate, which stores a std::vector<bool> of the states of the control qubits, and a Gate * pointer to the controlled gate object.
I am going to support them in the simulator branch first before merging into the master branch.
We assumed all controlled gates to be controlling on the
|1>
state. It can be useful to also support controlled gates on the|0>
state, like theCX[0](q_0, q_1)
gate on the left.To support them, I am thinking to add a
class GeneralControlledGate : public Gate
, which stores astd::vector<bool>
of the states of the control qubits, and aGate *
pointer to the controlled gate object.I am going to support them in the
simulator
branch first before merging into themaster
branch.