Function __attribute__((visibility(“default”)))

Function Documentation

gate::__attribute__((visibility("default")))

Generate a quantum gate from a string.

The tring for generating the gate is as follows: Identity : I <index> X : X <index> Y : Y <index> Z : Z <index> H : H <index> S : S <index> Sdag : Sdag <index> T : T <index> Tdag : Tdag <index> CNOT,CX : CNOT <control> <target>, or CX <control> <target> CZ : CZ <control> <target> SWAP : SWAP <target1> <target2> U1 : U1 <index> <angle1> U2 : U2 <index> <angle1> <angle2> U3 : U3 <index> <angle1> <angle2> <angle3> Rot X : RX <index> <angle1> Rot Y : RY <index> <angle1> Rot Z : RZ <index> <angle1> DifRot X : RDX <index> DifRot Y : RDY <index> DifRot Z : RDZ <index> MultiRot : RM <paulistr> <index1> <index2> … <theta> (for example: “RM XYZ 2 3 1 0.123”) DifMultiRot : RDM <paulistr> <index1> <index2> … (for example: “RDM XYZ 2 3 1”) general U : U <index_count> <index1> <index2> … <element1_real> <element1_imag> <element2_real> …

Identity gate does not change the state, but behaves differently when noise is added.

Generate

\(X\) gate
Return

Instance of generated gate Generate Identity gate

Return

Instance of generated gate

Parameters
  • [in] gate_string: Strint to generate the gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(Y\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(Z\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate Hadamard gate

Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(S\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(S^{\dagger}\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(T\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(T^{\dagger}\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(\sqrt{X}\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(\sqrt{X}^{\dagger}\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(\sqrt{Y}\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate

\(\sqrt{Y}^{\dagger}\) gate
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate a gate that projects

qubit_index </ code> to 0
Return

Instance of generated gate

Parameters
  • [in] qubit_index: Subscript of target qubit

Generate a gate that projects