mindquantum.core.gates.UnivMathGate

mindquantum.core.gates.UnivMathGate#

class mindquantum.core.gates.UnivMathGate(name, matrix_value)#

Universal math gate.

More usage, please see XGate.

Parameters:
  • name (str) – the name of this gate.

  • matrix_value (np.ndarray) – the matrix value of this gate.

Examples

>>> from mindquantum.core.gates import UnivMathGate
>>> x_mat=np.array([[0,1],[1,0]])
>>> X_gate=UnivMathGate('X',x_mat)
>>> x1=X_gate.on(0,1)
>>> print(x1)
X(0 <-: 1)
get_cpp_obj()#

Get the underlying C++ object.