Beispiel #1
0
 def __lt__(self, other):
     assert self.otype.data_otype() == gpt.ot_singlet
     assert other.otype.data_otype() == gpt.ot_singlet
     res = gpt.lattice(self)
     params = {"operator": "<"}
     cgpt.binary(res.v_obj[0], self.v_obj[0], other.v_obj[0], params)
     return res
Beispiel #2
0
def multiply(a, b):
    a = gpt(a)
    b = gpt(b)
    assert a.otype.__name__ == b.otype.__name__
    res = gpt.lattice(a)
    params = {"operator": "*"}
    n = len(res.v_obj)
    assert n == len(a.v_obj)
    assert n == len(b.v_obj)
    for i in range(n):
        cgpt.binary(res.v_obj[i], a.v_obj[i], b.v_obj[i], params)
    return res