Skip to main content
IBM Quantum Platform

anti_commutator

anti_commutator(op_a, op_b)

2つの演算子の反交換子を計算します。

アンチコミューテーターは次のように定義される:

{A,B}=AB+BA\{A, B\} = AB + BA

このメソッドをサポートする演算子は、この SupportsCommutators プロトコルを実装する必要があります。

両方の入力は、同じ演算子型でなければなりません。 これにより、出力タイプも決定されます。

>>> from qiskit_fermions.operators import FermionOperator
>>> from qiskit_fermions.operators.library import anti_commutator
>>> op1 = FermionOperator.from_dict({((True, 0), (False, 0)): 1})
>>> op2 = FermionOperator.from_dict({((False, 0), (True, 0)): 2})
>>> comm = anti_commutator(op1, op2)
>>> comm = comm.normal_ordered()
>>> canon = comm.simplify()
>>> assert canon == FermionOperator.zero()

パラメーター

  • op_a (T) – 上記の AA 演算子。
  • op_b (T) – 上記の BB 演算子。

戻り値

反コミューテーター {A,B}\{A, B\}

戻りの型

T

このページは役に立ちましたか?
バグや誤字の報告、またはコンテンツの要求はGitHubで行ってください。