Exemplo n.º 1
0
 def fermion_generator(self) -> 'openfermion.FermionOperator':
     """The FermionOperator G such that the gate's unitary is exp(-i t G)
     with exponent t using the Jordan-Wigner transformation."""
     half_generator = sum(
         (w * G
          for w, G in zip(self.weights, self.fermion_generator_components())
          ), ops.FermionOperator())
     return half_generator + hermitian_conjugated(half_generator)
Exemplo n.º 2
0
 def fermion_generator_components():
     return (
         ops.FermionOperator(((0, 1), (1, 0), (2, 0), (3, 1)), -1),
         ops.FermionOperator(((0, 1), (1, 0), (2, 1), (3, 0))),
         ops.FermionOperator(((0, 1), (1, 1), (2, 0), (3, 0)), -1),
     )
Exemplo n.º 3
0
 def fermion_generator_components():
     return (
         ops.FermionOperator(((0, 1), (1, 0))),
         ops.FermionOperator(((0, 1), (0, 0), (1, 1), (1, 0)), 0.5),
     )