예제 #1
0
def test_symmetric_hamiltonian(symmetry_operations, expr_basis, repr_basis,
                               result):
    """
    Test the method for calculating the symmetric Hamiltonian.
    """
    assert sorted(kp.symmetric_hamiltonian(*symmetry_operations,
                                           expr_basis=expr_basis,
                                           repr_basis=repr_basis),
                  key=str) == sorted(result, key=str)
예제 #2
0
def print_result(order):
    """prints the basis for a given order of k"""
    print('Order:', order)
    for m in kp.symmetric_hamiltonian(
        *symmetry_generators,
        expr_basis=kp.monomial_basis(order),
        repr_basis=kp.hermitian_basis(len(orbitals))
    ):
        print(m)
    print()
예제 #3
0
def print_result(order):
    """prints the basis for a given order of k"""
    print('Order:', order)
    for m in kp.symmetric_hamiltonian(c2y,
                                      parity,
                                      time_reversal,
                                      expr_basis=kp.monomial_basis(order),
                                      repr_basis=basis):
        print(m)
    print()
def test_symmetric_hamiltonian(symmetry_operations, expr_basis, repr_basis,
                               result):
    assert kp.symmetric_hamiltonian(*symmetry_operations,
                                    expr_basis=expr_basis,
                                    repr_basis=repr_basis) == result