mindquantum.core.gates.FSim

View Source On Gitee
class mindquantum.core.gates.FSim(theta: ParameterResolver, phi: ParameterResolver)[source]

FSim gate represent fermionic simulation gate.

The matrix is:

\[\begin{split}{\rm FSim}(\theta, \phi) = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & \cos(\theta) & -i\sin(\theta) & 0\\ 0 & -i\sin(\theta) & \cos(\theta) & 0\\ 0 & 0 & 0 & e^{-i\phi}\\ \end{pmatrix}\end{split}\]
Parameters

Examples

>>> from mindquantum.core.gates import FSim
>>> fsim = FSim('a', 'b').on([0, 1])
>>> fsim
FSim(θ=a, φ=b|0 1)
get_cpp_obj()[source]

Construct cpp obj.

hermitian()[source]

Get the hermitian gate of FSim.

Examples

>>> from mindquantum.core.gates import FSim
>>> fsim = FSim('a', 'b').on([0, 1])
>>> fsim.hermitian()
FSim(θ=-a, φ=-b|0 1)
matrix(pr: ParameterResolver = None, full=False)[source]

Get the matrix of FSim.

Parameters
  • pr (Union[ParameterResolver, dict]) – The parameter of fSim gate. Default: None.

  • full (bool) – Whether to get the full matrix of this gate (the gate should be acted on some qubits). Default: False.

property phi: mindquantum.core.parameterresolver.parameterresolver.ParameterResolver

Get phi parameter of FSim gate.

Returns

ParameterResolver, the phi.

property theta: mindquantum.core.parameterresolver.parameterresolver.ParameterResolver

Get theta parameter of FSim gate.

Returns

ParameterResolver, the theta.