Skip to main content
IBM Quantum Platform

SupportsCommutators

class SupportsCommutators(*args, **kwargs)

베이스: Protocol

효율적인 커뮤테이터 생성을 지원하는 프로토콜.

이 프로토콜을 구현하려면 다음 세 가지 방법이 필요합니다. 이러한 메서드로 호출을 전달하는 타입에 구애받지 않는 헬퍼 함수에 대해서는 double_commutator() commutator(), anti_commutator(), 및 을 참조하십시오.

>>> from qiskit_fermions.operators import FermionOperator
>>> cre_0 = FermionOperator.from_dict({((True, 0),): 1.0})
>>> ann_0 = FermionOperator.from_dict({((False, 0),): 1.0})
>>> comm = FermionOperator._commutator_(cre_0, ann_0)
>>> print(format(comm.normal_ordered().simplify()))
 -1.000000e0 +0.000000e0j * ()
  2.000000e0 +0.000000e0j * (+0 -0)

프로토콜 방법

_anti_commutator_

static _anti_commutator_(op_a, op_b)

두 연산자 인스턴스의 반교환자를 계산합니다.

자세한 내용은 여기를 anti_commutator() 참조하십시오.

매개변수

  • op_a (T)
  • op_b (T)

리턴 유형

T

_commutator_

static _commutator_(op_a, op_b)

두 연산자 인스턴스의 교환자를 계산합니다.

자세한 내용은 여기를 commutator() 참조하십시오.

매개변수

  • op_a (T)
  • op_b (T)

리턴 유형

T

_double_commutator_

static _double_commutator_(op_a, op_b, op_c, sign)

세 개의 연산자 인스턴스에 대한 이중 교환자를 계산합니다.

자세한 내용은 여기를 double_commutator() 참조하십시오.

매개변수

  • op_a (T)
  • op_b (T)
  • op_c (T)
  • sign (bool)

리턴 유형

T

이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.