def METHOD_NAME(self):
    """Test external field."""
    line = LineLattice(num_nodes=2)
    xyz_ext_magnetic_field = (1.0, 1.0, 1.0)
    xyz_test_hm = HeisenbergModel(lattice=line, ext_magnetic_field=xyz_ext_magnetic_field)
    with self.subTest("Check if if x, y and z params are being applied."):
        terms = [
            ("X_0 X_1", 1.0),
            ("Y_0 Y_1", 1.0),
            ("Z_0 Z_1", 1.0),
            ("X_0", 1.0),
            ("X_1", 1.0),
            ("Y_0", 1.0),
            ("Y_1", 1.0),
            ("Z_0", 1.0),
            ("Z_1", 1.0),
        ]
        hamiltonian = terms
        self.assertSetEqual(set(hamiltonian), set(xyz_test_hm.second_q_op().items()))