def make_hardcore_boson_hamiltonian(self):
    if (not self.transformation.up_then_down):
        warnings.warn("Hardcore-Boson Hamiltonian without reordering will result in non-consecutive Hamiltonians that are eventually not be combinable with other features of tequila. Try transformation='ReorderedJordanWigner' or similar for more consistency", TequilaWarning)
    n_orbitals = self.n_orbitals
    (c, obt, tbt) = self.get_integrals()
    h = numpy.zeros(shape=([n_orbitals] * 2))
    g = numpy.zeros(shape=([n_orbitals] * 2))
    for p in range(n_orbitals):
        h[(p, p)] += (2 * obt[(p, p)])
        for q in range(n_orbitals):
            h[(p, q)] += (+ tbt[(p, p, q, q)])
            if (p != q):
                g[(p, q)] += ((2 * tbt[(p, q, q, p)]) - tbt[(p, q, p, q)])
    H = c
    for p in range(n_orbitals):
        for q in range(n_orbitals):
            up = p
            uq = q
            H += (((h[(p, q)] * Sm(up)) * Sp(uq)) + ((((g[(p, q)] * Sm(up)) * Sp(up)) * Sm(uq)) * Sp(uq)))
    return H
def make_hardcore_boson_hamiltonian(self):
    if (not self.transformation.up_then_down):
        warnings.warn("Hardcore-Boson Hamiltonian without reordering will result in non-consecutive Hamiltonians that are eventually not be combinable with other features of tequila. Try transformation='ReorderedJordanWigner' or similar for more consistency", TequilaWarning)
    n_orbitals = self.n_orbitals
    (c, obt, tbt) = self.get_integrals()
    h = numpy.zeros(shape=([n_orbitals] * 2))
    g = numpy.zeros(shape=([n_orbitals] * 2))
    for p in range(n_orbitals):
        h[(p, p)] += (2 * obt[(p, p)])
        for q in range(n_orbitals):
            h[(p, q)] += (+ tbt[(p, p, q, q)])
            if (p != q):
                g[(p, q)] += ((2 * tbt[(p, q, q, p)]) - tbt[(p, q, p, q)])
    H = c
    for p in range(n_orbitals):
        for q in range(n_orbitals):
            up = p
            uq = q
            H += (((h[(p, q)] * Sm(up)) * Sp(uq)) + ((((g[(p, q)] * Sm(up)) * Sp(up)) * Sm(uq)) * Sp(uq)))
    return H