def test_multiset_permutation_2(): a = SecondQuantizedOperator("g0,g1,g2", "p0,p1,p2", 'spin-integrated') p_cre = [[Index(i) for i in "g0,g1,g2".split(',')]] p_ann = [[Index('p0')], [Index('p1')], [Index('p2')]] assert a.exist_permute_format(p_cre, p_ann) assert a.n_multiset_permutation(p_cre, p_ann) == 6 p_ann = [[Index('p0'), Index('p1')], [Index('p2')]] assert a.n_multiset_permutation(p_cre, p_ann) == 3
def test_multiset_permutation_5(): # n_multiset_permutation for spin-adapted operators is always one a = SecondQuantizedOperator("g0,v1,p2", "p0,a1,c2", 'spin-adapted') p_cre = [[Index('g0'), Index('v1'), Index('p2')]] p_ann = [[Index('p0')], [Index('a1')], [Index('c2')]] assert not a.exist_permute_format(p_cre, p_ann) assert a.n_multiset_permutation(p_cre, p_ann) == 1
def test_multiset_permutation_4(): a = SecondQuantizedOperator("g0,v1,p2", "p0,a1,c2", 'spin-orbital') p_cre = [[Index('g0'), Index('v1'), Index('p2')]] p_ann = [[Index('p0'), Index('a1'), Index('c2')]] assert not a.exist_permute_format(p_cre, p_ann) assert a.n_multiset_permutation(p_cre, p_ann) == 1
def test_multiset_permutation_3(): a = SecondQuantizedOperator("g0,v1,p2", "p0,a1,p2", 'spin-integrated') p_cre = [[Index('g0')], [Index('v1')], [Index('p2')]] p_ann = [[Index('p0'), Index('p2')], [Index('a1')]] assert a.exist_permute_format(p_cre, p_ann) assert a.n_multiset_permutation(p_cre, p_ann) == 18
def test_multiset_permutation_1(): a = SecondQuantizedOperator("g0,g1,g2", "p0,p1,p2", 'spin-orbital') p_cre = [[Index(i) for i in "g0,g1,g2".split(',')]] p_ann = [[Index(i) for i in "p0,p1,p2".split(',')]] assert not a.exist_permute_format(p_cre, p_ann) assert a.n_multiset_permutation(p_cre, p_ann) == 1