def test_strong_interaction_hubbard_VT_order_gives_larger_error(self): hamiltonian = normal_ordered(fermi_hubbard(4, 4, 1., 10.0)) TV_error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='T+V')) TV_error_bound = numpy.sum(numpy.absolute( list(TV_error_operator.terms.values()))) VT_error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='V+T')) VT_error_bound = numpy.sum(numpy.absolute( list(VT_error_operator.terms.values()))) self.assertGreater(VT_error_bound, TV_error_bound)
def test_intermediate_interaction_hubbard_TV_order_has_larger_error(self): hamiltonian = normal_ordered(fermi_hubbard(4, 4, 1., 4.0)) TV_error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='T+V')) TV_error_bound = numpy.sum(numpy.absolute( list(TV_error_operator.terms.values()))) VT_error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='V+T')) VT_error_bound = numpy.sum(numpy.absolute( list(VT_error_operator.terms.values()))) self.assertAlmostEqual(TV_error_bound, 1706.66666666666) self.assertAlmostEqual(VT_error_bound, 1365.33333333333)
def test_1d_jellium_wigner_seitz_10_VT_order_gives_larger_error(self): hamiltonian = normal_ordered(jellium_model( hypercube_grid_with_given_wigner_seitz_radius_and_filling( 1, 5, wigner_seitz_radius=10., spinless=True), spinless=True, plane_wave=False)) TV_error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='T+V')) TV_error_bound = numpy.sum(numpy.absolute( list(TV_error_operator.terms.values()))) VT_error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='V+T')) VT_error_bound = numpy.sum(numpy.absolute( list(VT_error_operator.terms.values()))) self.assertGreater(VT_error_bound, TV_error_bound)
def test_split_operator_error_operator_VT_order_against_definition(self): hamiltonian = (normal_ordered(fermi_hubbard(3, 3, 1., 4.0)) - 2.3 * FermionOperator.identity()) potential_terms, kinetic_terms = ( diagonal_coulomb_potential_and_kinetic_terms_as_arrays( hamiltonian)) potential = sum(potential_terms, FermionOperator.zero()) kinetic = sum(kinetic_terms, FermionOperator.zero()) error_operator = ( split_operator_trotter_error_operator_diagonal_two_body( hamiltonian, order='V+T')) # V-then-T ordered double commutators: [V, [T, V]] + [T, [T, V]] / 2 inner_commutator = normal_ordered(commutator(kinetic, potential)) error_operator_definition = normal_ordered( commutator(potential, inner_commutator)) error_operator_definition += normal_ordered( commutator(kinetic, inner_commutator)) / 2.0 error_operator_definition /= 12.0 self.assertEqual(error_operator, error_operator_definition)