Skip to content

Commit 034c447

Browse files
Fixed xtb multiplicity for multiplicities other than 1
1 parent 9744e28 commit 034c447

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ccinput/packages/xtb.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def handle_parameters(self):
9797
self.main_command += f"--chrg {self.calc.charge} "
9898

9999
if self.calc.multiplicity != 1:
100-
self.main_command += f"--uhf {self.calc.multiplicity} "
100+
# uhf is the number of unpaired electrons
101+
self.main_command += f"--uhf {self.calc.multiplicity-1} "
101102

102103
def handle_constraints_scan(self):
103104
if len(self.calc.constraints) == 0:

ccinput/tests/test_xtb.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_sp_multiplicity(self):
4343

4444
xtb = self.generate_calculation(**params)
4545

46-
REF = "xtb Cl.xyz --uhf 2"
46+
REF = "xtb Cl.xyz --uhf 1"
4747

4848
self.assertTrue(self.is_equivalent(REF, xtb.command))
4949
self.assertTrue(self.is_equivalent("", xtb.input_file))
@@ -59,7 +59,7 @@ def test_sp_charge_multiplicity(self):
5959

6060
xtb = self.generate_calculation(**params)
6161

62-
REF = "xtb Cl.xyz --chrg -1 --uhf 3"
62+
REF = "xtb Cl.xyz --chrg -1 --uhf 2"
6363

6464
self.assertTrue(self.is_equivalent(REF, xtb.command))
6565
self.assertTrue(self.is_equivalent("", xtb.input_file))

0 commit comments

Comments
 (0)