mindquantum.core.gates.Power

View Source On Gitee
class mindquantum.core.gates.Power(gate, exponent=0.5)[source]

Power operator on a non parameterized gate.

Parameters
  • gates (NoneParameterGate) – The basic gate you need to apply power operator.

  • exponent (int, float) – The exponent. Default: 0.5.

Examples

>>> from mindquantum.core.gates import Power
>>> import numpy as np
>>> rx1 = RX(0.5)
>>> rx2 = RX(1)
>>> assert np.all(np.isclose(Power(rx2,0.5).matrix(), rx1.matrix()))
get_cpp_obj()[source]

Get the underlying C++ object.