From 034c44770c7391a53d7b79e03a721c8d63abb0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Robidas?= Date: Wed, 13 Nov 2024 11:48:28 -0500 Subject: [PATCH] Fixed xtb multiplicity for multiplicities other than 1 --- ccinput/packages/xtb.py | 3 ++- ccinput/tests/test_xtb.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ccinput/packages/xtb.py b/ccinput/packages/xtb.py index 410d363..5d223d9 100644 --- a/ccinput/packages/xtb.py +++ b/ccinput/packages/xtb.py @@ -97,7 +97,8 @@ def handle_parameters(self): self.main_command += f"--chrg {self.calc.charge} " if self.calc.multiplicity != 1: - self.main_command += f"--uhf {self.calc.multiplicity} " + # uhf is the number of unpaired electrons + self.main_command += f"--uhf {self.calc.multiplicity-1} " def handle_constraints_scan(self): if len(self.calc.constraints) == 0: diff --git a/ccinput/tests/test_xtb.py b/ccinput/tests/test_xtb.py index a6526bc..c41ff23 100644 --- a/ccinput/tests/test_xtb.py +++ b/ccinput/tests/test_xtb.py @@ -43,7 +43,7 @@ def test_sp_multiplicity(self): xtb = self.generate_calculation(**params) - REF = "xtb Cl.xyz --uhf 2" + REF = "xtb Cl.xyz --uhf 1" self.assertTrue(self.is_equivalent(REF, xtb.command)) self.assertTrue(self.is_equivalent("", xtb.input_file)) @@ -59,7 +59,7 @@ def test_sp_charge_multiplicity(self): xtb = self.generate_calculation(**params) - REF = "xtb Cl.xyz --chrg -1 --uhf 3" + REF = "xtb Cl.xyz --chrg -1 --uhf 2" self.assertTrue(self.is_equivalent(REF, xtb.command)) self.assertTrue(self.is_equivalent("", xtb.input_file))