def test_get_interaction_operator_two_body(self):
    interaction_operator = get_interaction_operator(FermionOperator('2^ 2 3^ 4'), self.n_qubits)
    two_body = numpy.zeros((self.n_qubits, self.n_qubits, self.n_qubits, self.n_qubits), float)
    two_body[(3, 2, 4, 2)] = (- 1.0)
    self.assertEqual(interaction_operator, InteractionOperator(0.0, self.one_body, two_body))
def test_get_interaction_operator_two_body(self):
    interaction_operator = get_interaction_operator(FermionOperator('2^ 2 3^ 4'), self.n_qubits)
    two_body = numpy.zeros((self.n_qubits, self.n_qubits, self.n_qubits, self.n_qubits), float)
    two_body[(3, 2, 4, 2)] = (- 1.0)
    self.assertEqual(interaction_operator, InteractionOperator(0.0, self.one_body, two_body))