def test_user_can_calculate_eeq_atomic_charges(lithium_hydride_coord): fileObject = open(lithium_hydride_coord, "r+") atoms = ksr.read(fileObject) molecule = Molecule(symbols=atoms) eeq = molecule.get_eeq(charge=0) want = [0.51925854, -0.35007273, -0.16918582] difference = sum([a - b for a, b in zip(want, eeq)]) assert difference < 1e-6
def test_a_user_can_compute_coordination_numbers_for_molecule( fluoromethane_coord): fileObject = open(fluoromethane_coord, "r+") atoms = ksr.read(fileObject) molecule = Molecule(symbols=atoms) cns = molecule.get_cns(cntype="exp") c1 = np.around(cns, decimals=1) got = c1[0] want = 4.0 assert got == want
def test_user_can_calculate_eeq_atomic_charges(): with tempfile.NamedTemporaryFile(mode="w+", encoding="utf-8") as f: f.write("$coord" + s) f.write("0 0 0 li" + s) f.write("0 0 2 h" + s) f.write("0 0 4 h" + s) f.write("$end") f.flush() fileObject = open(f.name, "r+") atoms = ksr.read(fileObject) molecule = Molecule(symbols=atoms) eeq = molecule.get_eeq(charge=0) want = [0.51925854, -0.35007273, -0.16918582] difference = sum([a - b for a, b in zip(want, eeq)]) assert difference < 1e-6
def getSubstructureFromPath(refmol: Molecule, path: np.ndarray) -> Molecule: """Create a molecules object from a substructure of given molecule.""" # initialize refat = refmol.get_atomic_numbers() refxyz = refmol.get_positions() # atoms from complex excluding old substrate atoms = [] for elem in path: atom = Atom(symbol=refat[elem], position=refxyz[elem, :]) atoms.append(atom) # create molecule from atoms return Molecule(symbols=atoms)
def test_molecule_is_not_none(): atoms = [] for i in range(2): atoms.append(Atom(symbol="H", position=(0, 0, i))) molecule = Molecule(atoms) atom = Atom(symbol="H", position=(0, 0, 4), molecule=molecule) assert atom.molecule is not None
def pyridine_mH(): """Create a pyridine molecule minus Hydrogen on carbon #0 and return as Molecule.""" coords = [ [1.3603, 0.0256, 0.0], [0.6971, -1.202, 0.0], [-0.6944, -1.2184, 0.0], [-1.3895, -0.0129, 0.0], [-0.6712, 1.1834, 0.0], [0.6816, 1.196, 0.0], [1.2665, -2.1365, 0.0], [-1.2365, -2.1696, 0.0], [-2.4837, 0.0011, 0.0], [-1.1569, 2.1657, 0.0], ] coords = [[float(j) / Bohr for j in i] for i in coords] symbols = [ "C", "C", "C", "C", "C", "N", "H", "H", "H", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)
def test_a_user_can_compute_coordination_numbers_for_molecule(): with tempfile.NamedTemporaryFile(mode="w+", encoding="utf-8") as f: f.write("$coord" + s) f.write(" 1.87167924 -0.101043656 0.1596818582 c" + s) f.write(" 4.43543289 -0.101043656 0.1596818582 f" + s) f.write(" 1.20847986 -1.386321988 1.6312493924 h" + s) f.write(" 1.20847986 -0.732816897 -1.6891694984 h" + s) f.write(" 1.20846096 1.816007916 0.5369845779 h" + s) f.write("$end") f.flush() fileObject = open(f.name, "r+") atoms = ksr.read(fileObject) molecule = Molecule(symbols=atoms) cns = molecule.get_cns(cntype="exp") c1 = np.around(cns, decimals=1) got = c1[0] want = 4.0 assert got == want
def test_user_can_pass_information_from_mol_to_mol(): reference = Molecule(atoms) ref = reference.get_number_of_atoms() molecule = Molecule(symbols=reference) nat = molecule.get_number_of_atoms() assert nat == ref positions = molecule.get_positions() assert positions[0][2] == 0 assert positions[1][2] == 1 assert positions[2][2] == 2 numbers = molecule.get_array("numbers") assert numbers[0] == 1
def constructMolecule(geometry: str, out: click.File) -> Molecule: """Helper function to construct a Molecule.""" try: with open(geometry, "r+") as fileObject: # read atoms from input file atoms = read(fileObject) # create molecule from atoms molecule = Molecule(symbols=atoms) except FileNotFoundError: errorbye("Input file not found.") return molecule
def acetylene(): """Create an acetylene molecule and return as Molecule.""" coords = [ [0.0, 0.0, -1.06176434496059], [0.0, 0.0, 1.06176434496059], ] symbols = [ "C", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)
def neopentane(): """Create a neopentane molecule and return as Molecule.""" coords = [ [0.000000, 0.0, 0.0], [0.881905, 0.881905, 0.881905], [-0.881905, -0.881905, 0.881905], [0.881905, -0.881905, -0.881905], [-0.881905, 0.881905, -0.881905], [-1.524077, 0.276170, -1.524077], [1.524077, 1.524077, 0.276170], [1.524077, -0.276170, -1.524077], [1.524077, 0.276170, 1.524077], [-1.524077, -0.276170, 1.524077], [1.524077, -1.524077, -0.276170], [-0.276170, 1.524077, -1.524077], [0.276170, 1.524077, 1.524077], [0.276170, -1.524077, -1.524077], [-0.276170, -1.524077, 1.524077], [-1.524077, 1.524077, -0.276170], [-1.524077, -1.524077, 0.276170], ] coords = [[float(j) / Bohr for j in i] for i in coords] symbols = [ "C", "C", "C", "C", "C", "H", "H", "H", "H", "H", "H", "H", "H", "H", "H", "H", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)
def toluene(): """Create a toluene molecule and return as Molecule.""" coords = [ [1.2264, 0.0427, 0.0670], [1.0031, -1.3293, 0.0600], [-0.2945, -1.8256, -0.0060], [-1.3704, -0.9461, -0.0646], [-1.1511, 0.4266, -0.0578], [0.1497, 0.9292, 0.0066], [0.3871, 2.3956, -0.0022], [2.2495, 0.4310, 0.1211], [1.8510, -2.0202, 0.1071], [-0.4688, -2.9062, -0.0109], [-2.3926, -1.3347, -0.1157], [-2.0006, 1.1172, -0.1021], [0.5024, 2.7582, -1.0330], [1.2994, 2.6647, 0.5466], [-0.4475, 2.9470, 0.4506], ] coords = [[float(j) / Bohr for j in i] for i in coords] symbols = [ "C", "C", "C", "C", "C", "C", "C", "H", "H", "H", "H", "H", "H", "H", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)
def propanolLowest(): """Create lowest conformer of 1-propanol and return as Molecule.""" coords = [ [-1.9554949371, 0.1467391618, 0.0031595607], [-0.5906278346, -0.5279387138, -0.0201649611], [0.5440986558, 0.4958779663, 0.0283462055], [0.4812068385, 1.1678478833, -0.8308000219], [0.4590669813, 1.0993020658, 0.9450529713], [1.8195161785, -0.0957487212, -0.0534239359], [1.9103706588, -0.7338049177, 0.6631507673], [-0.5004127933, -1.2028008461, 0.8364936998], [-0.4854009629, -1.1250023438, -0.9282499098], [-2.7476736372, -0.5972665554, -0.0242488945], [-2.0700756998, 0.8040326560, -0.8554507953], [-2.0722381370, 0.7410005769, 0.9069567477], ] symbols = [ "C", "C", "C", "H", "H", "O", "H", "H", "H", "H", "H", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)
def propanolIntermediate(): """Create higher conformer of 1-propanol and return as Molecule.""" coords = [ [-1.60306996, 0.10333519, 0.50792736], [-0.66904416, -0.46962566, -0.55371646], [0.67345677, 0.26436258, -0.61179298], [1.26292797, -0.10585085, -1.45392921], [0.49744830, 1.34089332, -0.75955140], [1.47742183, 0.05176805, 0.52349829], [0.98773122, 0.34094585, 1.30125393], [-0.48213061, -1.52528483, -0.34815476], [-1.14165995, -0.39229359, -1.53423716], [-2.56608070, -0.40007121, 0.47312929], [-1.76619136, 1.16652831, 0.34003517], [-1.19366144, -0.03197289, 1.50775619], ] symbols = [ "C", "C", "C", "H", "H", "O", "H", "H", "H", "H", "H", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)
def test_user_can_get_number_of_atoms(): reference = Molecule(atoms) nat = reference.get_number_of_atoms() assert nat == 3
def test_user_can_copy_a_mol(): reference = Molecule(atoms) new = reference.copy() numbers = new.get_atomic_numbers() assert numbers[0] == 1
def test_user_can_get_atomic_numbers(): reference = Molecule(atoms) numbers = reference.get_atomic_numbers() assert numbers[0] == 1
def test_user_can_copy_an_array(): reference = Molecule(atoms) numbers = reference.get_array("numbers", True) assert numbers[0] == 1
def test_user_can_create_mol_without_positions(): molecule = Molecule(symbols=1, positions=None) assert len(molecule.get_positions()) == 0
def exchangeSubstructure( n: int, center: int, subnr: int, bonds, ref: Molecule, newsub: Molecule, newSubBonds, name: str, rotate: int, exclude: bool, ) -> Molecule: """Exchange substructure (subnr) from ref with substrate.""" # setup initial complex refxyz = ref.get_positions() refat = ref.get_atomic_numbers() refnat = ref.get_number_of_atoms() # match new and old substrate newat = newsub.get_atomic_numbers() newnat = newsub.get_number_of_atoms() # extract coordinates of central atom centralAtom = refxyz[center, :] mol = Molecule() for i in range(len(bonds[center])): if i == subnr: path = np.zeros(shape=(n, ), dtype=np.int32) # set all elements to -1 path.fill(-1) partner = bonds[center][i] count = Counter() # type: ignore count["step"] = -1 getSubstructures(n, bonds, center, partner, path, count=count) # get rid of -1 elements path = [x for x in path if x != -1] path = np.array(path) # create molecule from given path oldsub = getSubstructureFromPath(ref, path) # get all bonding partner oldSubBonds = oldsub.get_bonds(partner="X") outxyz = matchSubstrates( bonds, newsub, newSubBonds, oldsub, oldSubBonds, centralAtom, ) # atoms from complex excluding old substrate atoms = [] for j in range(refnat): if j in path: continue atom = Atom(symbol=refat[j], position=refxyz[j, :]) atoms.append(atom) # atoms from new substrate # Should we rotate the substrate around covalent bond? if rotate: theta = rotate origin = refxyz[center, :] partner = outxyz[0, :] outxyz2 = np.zeros(shape=outxyz.shape, dtype=np.float64) # reference shift refShift = getRodriguezRotation(partner, origin, partner, theta) shift = outxyz[0, :] - refShift for j in range(newnat): outxyz2[j, :] = getRodriguezRotation( outxyz[j, :], origin, partner, theta, ) outxyz2[j, :] += shift atom = Atom(symbol=newat[j], position=outxyz2[j, :]) atoms.append(atom) else: for j in range(newnat): atom = Atom(symbol=newat[j], position=outxyz[j, :]) atoms.append(atom) # create molecule from atoms mol = Molecule(symbols=atoms) # write new structure in xyz format mol.writeMolecule(name + ".xyz") # write constrain file refnat = ref.get_number_of_atoms() oldnat = oldsub.get_number_of_atoms() nat = refnat - oldnat writeTransitionMetalConstrains(nat, newnat, newSubBonds, exclude) return mol return mol
def getClassicalSterimol(mol: Molecule, origin: int, partner: int): """Verloop definitions for L, B1, and B5 steric parameter. We apply kallisto van der Waals radii. Initial implementation in Morfeus (https://kjelljorner.github.io/morfeus/sterimol.html) integrated by permission of Kjell Jorner.""" # initialize coordinates coords = mol.get_positions() # get van der Waals radii in Bohr vdw = mol.get_vdw(charge=0, vdwtype="rahm", scale=1) # shift all atoms wrt origin coords -= coords[origin] # extract vector origin -> attachted and normalize vector = coords[partner] - coords[origin] vector /= np.linalg.norm(vector) # align vector and x-axis xaxis = np.array([1, 0, 0]) dot = np.dot(vector, xaxis).reshape(1) + 1 # define zaxis and cover antiparallel case zaxis = np.array([0, 0, 1]) epsilon = 1e-06 if dot < epsilon: w = np.cross(vector, zaxis) if np.linalg.norm(w) < epsilon: w = np.cross(vector, xaxis) else: w = np.cross(vector, xaxis) # define quaternion q and normalize q = np.concatenate((w, dot)) q /= np.linalg.norm(q) # rotate coordinates according to q u = R.from_quat(q) coords = u.apply(coords) # project coordinates on vector vector = coords[partner] - coords[origin] unitVector = vector / np.linalg.norm(vector) # project coordinates on vectors vdw = np.vstack(vdw).reshape(-1) cvalues = np.dot(unitVector.reshape(1, -1), coords.T) projected = cvalues + vdw lval = np.max(projected) # L = unitVector * lval # L = L.reshape(-1) # B min and max values r = 1 slices = 360 theta = np.linspace(0, 2 * np.pi, slices) x = np.zeros(shape=(len(theta),), dtype=np.float64) y = r * np.cos(theta) z = r * np.sin(theta) vectors = np.column_stack((x, y, z)) cvalues = np.dot(vectors, coords.T) projected = cvalues + vdw maxValues = np.max(projected, axis=1) bminVal = np.min(maxValues) bmaxVal = np.max(maxValues) return lval, bminVal, bmaxVal
def matchSubstrates( bonds: np.ndarray, new: Molecule, bondsNewSub: np.ndarray, old: Molecule, bondsOldSub, center: np.ndarray, ) -> np.ndarray: """Match substrates by root mean squared deviation measure.""" # check is central atom given centered = False count = 1 if center is not None: centered = True count = 2 newnat = new.get_number_of_atoms() newxyz = np.zeros(shape=(newnat, 3), dtype=np.float64) newxyz = new.get_positions() oldnat = old.get_number_of_atoms() oldxyz = np.zeros(shape=(oldnat, 3), dtype=np.float64) oldxyz = old.get_positions() # shift to first atom of old substrate shift = np.zeros(shape=(3, ), dtype=np.float64) shift = oldxyz[0, :] oldShift = shift oldxyz2 = np.zeros(shape=(oldnat, 3), dtype=np.float64) for i in range(oldnat): oldxyz2[i][:] = oldxyz[i][:] - shift # shift to first atom of new substrate shift = newxyz[0, :] newxyz2 = np.zeros(shape=(newnat, 3), dtype=np.float64) for i in range(newnat): newxyz2[i][:] = newxyz[i][:] - shift # covalent bonding partner in old substrate covOld = len(bondsOldSub[0][:]) # covalent bonding partner in new substrate covNew = len(bondsNewSub[0][:]) # Check for linear moleule case if covNew != 1: isNotLinear = True else: isNotLinear = False covOld += count covNew += count # get structures for RMSD alignment shiftOldSub = np.zeros(shape=(covOld, 3), dtype=np.float64) shiftOldSub[0, :] = oldxyz2[0, :] shiftNewSub = np.zeros(shape=(covNew, 3), dtype=np.float64) shiftNewSub[0, :] = newxyz2[0, :] # shift old substrate i = 0 for j in range(len(bondsOldSub[0][:])): i += 1 k = bondsOldSub[0][j] shiftOldSub[i, :] = oldxyz2[k, :] # shift new substrate i = 0 for j in range(len(bondsNewSub[0][:])): i += 1 k = bondsNewSub[0][j] shiftNewSub[i, :] = newxyz2[k, :] if centered: indexOld = covOld - 1 indexNew = covNew - 1 shiftOldSub[indexOld, :] = center - oldShift shiftNewSub[indexNew][:] = 0 distRef = distance.euclidean(shiftOldSub[0, :], shiftOldSub[indexOld, :]) getNewSubstrateCenter(indexNew, shiftNewSub, distRef) bdim = np.minimum(covOld, covNew) if bdim >= 3: bdim = 3 b1xyz = np.zeros(shape=(bdim, 3), dtype=np.ndarray) b2xyz = np.zeros(shape=(bdim, 3), dtype=np.ndarray) indexOld = covOld - 1 indexNew = covNew - 1 b1xyz[0][:] = shiftOldSub[0][:] b1xyz[1][:] = shiftOldSub[1][:] b1xyz[2][:] = shiftOldSub[indexOld][:] b2xyz[0][:] = shiftNewSub[0][:] b2xyz[1][:] = shiftNewSub[1][:] b2xyz[2][:] = shiftNewSub[indexNew][:] else: bdim = 2 b1xyz = np.zeros(shape=(bdim, 3), dtype=np.ndarray) b2xyz = np.zeros(shape=(bdim, 3), dtype=np.ndarray) indexOld = covOld - 1 indexNew = covNew - 1 b1xyz[0][:] = shiftOldSub[0][:] b1xyz[1][:] = shiftOldSub[indexOld][:] b2xyz[0][:] = shiftNewSub[0][:] b2xyz[1][:] = shiftNewSub[indexNew][:] tmpxyz = np.zeros(shape=(newnat, 3), dtype=np.float64) outxyz = np.zeros(shape=(newnat, 3), dtype=np.float64) if isNotLinear: u = np.zeros(shape=(3, 3), dtype=np.float64) # get RMSD value and rotation matrix _, u = rmsd(bdim, b2xyz, b1xyz) tmpxyz = np.matmul(u.T, newxyz2[:][0:newnat].T) # shift for i in range(newnat): outxyz[i, :] = tmpxyz.T[i, :] + oldShift return outxyz tmpxyz = newxyz2[:][0:newnat] # shift for i in range(newnat): outxyz[i, :] = tmpxyz[i, :] + oldShift return outxyz
def test_user_cannot_create_array_with_different_size(): reference = Molecule(atoms) with pytest.raises(Exception) as error: reference.new_array("symbol", []) assert error.value.args[0] == 'Array "symbol" has wrong length: 0 != 3.'
def test_user_can_set_an_array(): reference = Molecule(atoms) reference.set_array("numbers", [1, 2, 3]) numbers = reference.get_array("numbers") assert numbers[0] == 1 assert numbers[1] == 2 assert numbers[2] == 3 reference.set_array("numbers", None) reference.set_array("numbers", None) with pytest.raises(Exception) as error: reference.get_array("numbers") assert error.value.args[0] == "numbers" reference.set_array("numbers", [1, 2, 3], None) numbers = reference.get_array("numbers") assert numbers[0] == 1
def test_user_cannot_set_array_with_different_sizes(): reference = Molecule(atoms) with pytest.raises(Exception) as error: reference.set_array("symbols", [1, 2, 3, 4]) assert "4 != 3" in error.value.args[0]
def test_user_cannot_create_existing_array(): reference = Molecule(atoms) reference.new_array("symbol", ["H", "H", "C"]) with pytest.raises(Exception) as error: reference.new_array("symbol", ["H", "H", "C"]) assert error.value.args[0] == 'Array "symbol" already present'
def iridiumCatalyst(): """Create an Iridium catalyst and return as Molecule.""" coords = [ [-1.3672999, -1.4398999, 0.1359000], [-2.4911998, -0.6808999, 0.1396000], [-3.6534996, -1.1211999, -0.5090000], [-3.6468996, -2.3434998, -1.1725999], [-2.4848998, -3.1187997, -1.1555999], [-1.3670999, -2.6316997, -0.4883000], [-0.4373000, -3.1872997, -0.4306000], [-2.4432998, -4.0866996, -1.6463998], [-4.5575996, -0.5223999, -0.4887000], [-2.4206998, 0.5908999, 0.8954999], [-1.2879999, 0.7903999, 1.6181998], [-1.1378999, 1.9348998, 2.3084998], [-2.1077998, 2.9319997, 2.3219998], [-3.2770997, 2.7402997, 1.5819998], [-3.4330997, 1.5600998, 0.8608999], [-4.3267996, 1.4057999, 0.2659000], [-1.9411998, 3.8419996, 2.8913997], [-0.1872000, 2.0459998, 2.8181997], [0.4009000, -0.6061999, 1.1172999], [-1.2690999, -3.8143996, 3.7856996], [-0.1664000, -4.5494996, 4.2269996], [1.1218999, -4.0950996, 3.9273996], [1.2993999, -2.9384997, 3.1675997], [0.2001000, -2.2075998, 2.6786997], [-1.0849999, -2.6466997, 3.0382997], [-1.9573998, -2.0870998, 2.7090997], [0.8509999, -0.7173999, 2.6636997], [2.3007998, -2.5989997, 2.9226997], [-0.3087000, -5.4547995, 4.8119995], [0.6392999, 0.6220999, -0.5923999], [-0.0586000, 0.3754000, -1.7751998], [0.0637000, 1.5387999, -2.6275997], [0.0955000, 1.0794999, -4.0821996], [0.8716999, 0.3276000, -4.2397996], [0.2802000, 1.9248998, -4.7547995], [-0.8681999, 0.6330999, -4.3491996], [-1.1760999, 2.4077998, -2.3666998], [-1.2042999, 3.2867997, -3.0193997], [-2.0717998, 1.8058998, -2.5499998], [-1.2019999, 2.7410997, -1.3247999], [1.3891999, 2.1923998, -2.1029998], [1.3915999, 1.7859998, -0.7128999], [2.6481997, 1.5975998, -2.7492997], [2.6573997, 0.5124000, -2.6283997], [2.7186997, 1.8556998, -3.8108996], [3.5309997, 1.9918998, -2.2375998], [1.4299999, 3.7172996, -2.1670998], [0.6241999, 4.1645996, -1.5814998], [2.3812998, 4.0763996, -1.7610998], [1.3476999, 4.0651996, -3.2032997], [2.0756998, 0.4378000, 1.7666998], [3.3654997, -0.0810000, 1.8671998], [4.2709996, 1.0315999, 2.0579998], [5.4819995, 0.5533999, 2.8527997], [5.1838995, 0.0640000, 3.7825996], [6.0490994, -0.1689000, 2.2567998], [6.1442994, 1.3928999, 3.0939997], [4.6909995, 1.5017999, 0.6583999], [5.4398995, 2.2997998, 0.7063999], [5.1090995, 0.6483999, 0.1171000], [3.8181996, 1.8505998, 0.1015000], [3.3502997, 2.0656998, 2.7942997], [2.0458998, 1.7442998, 2.2507998], [3.6590996, 3.5300997, 2.4959998], [3.5358997, 3.7464996, 1.4332999], [2.9753997, 4.1760996, 3.0565997], [4.6847995, 3.7776996, 2.7930997], [3.2796997, 1.8273998, 4.3083996], [3.0708997, 0.7747999, 4.5225996], [4.2123996, 2.1093998, 4.8080995], [2.4671998, 2.4302998, 4.7258995], [1.7917998, -1.7489998, 0.1412000], [1.8500998, -3.1467997, 0.2110000], [3.0569997, -3.5802997, -0.4612000], [4.1632996, -3.6178996, 0.6029999], [4.3272996, -2.6173997, 1.0149999], [3.8420996, -4.2739996, 1.4174999], [5.1055995, -3.9992996, 0.1957000], [2.8261997, -4.9693995, -1.0466999], [2.6792997, -5.6906994, -0.2364000], [3.6907996, -5.2904995, -1.6389998], [1.9392998, -4.9911995, -1.6839998], [3.2640997, -2.4330998, -1.5048999], [2.7238997, -1.2952999, -0.7998999], [4.7166995, -2.1413998, -1.8718998], [5.1881995, -3.0188997, -2.3293998], [4.7565995, -1.3170999, -2.5912997], [5.2941995, -1.8488998, -0.9925999], [2.4197998, -2.6279997, -2.7728997], [1.3752999, -2.8206997, -2.5121998], [2.4501998, -1.7101998, -3.3667997], [2.7924997, -3.4536997, -3.3878997], [-2.2764998, -4.1481996, 4.0262996], [1.9905998, -4.6454995, 4.2840996], [-4.5414996, -2.6926997, -1.6821998], [-4.0522996, 3.5020997, 1.5576998], ] coords = [[float(j) / Bohr for j in i] for i in coords] symbols = [ "N", "C", "C", "C", "C", "C", "H", "H", "H", "C", "N", "C", "C", "C", "C", "H", "H", "H", "Ir", "C", "C", "C", "C", "C", "C", "H", "H", "H", "H", "B", "O", "C", "C", "H", "H", "H", "C", "H", "H", "H", "C", "O", "C", "H", "H", "H", "C", "H", "H", "H", "B", "O", "C", "C", "H", "H", "H", "C", "H", "H", "H", "C", "O", "C", "H", "H", "H", "C", "H", "H", "H", "B", "O", "C", "C", "H", "H", "H", "C", "H", "H", "H", "C", "O", "C", "H", "H", "H", "C", "H", "H", "H", "H", "H", "H", "H", ] atoms = [] for i, _ in enumerate(coords): atoms.append(Atom(symbols[i], position=coords[i])) return Molecule(symbols=atoms)