Skip to content

Commit

Permalink
test_molecule: workaround for existing xyz file
Browse files Browse the repository at this point in the history
  • Loading branch information
damarkian committed Dec 15, 2023
1 parent 7503ae6 commit f6b5dbc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_molecule.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Test Molecule class functions
"""

import os.path
import numpy as np
import pytest
from qibo import gates, models
Expand All @@ -25,8 +25,11 @@ def test_run_pyscf():

def test_run_pyscf_molecule_xyz():
"""Pyscf driver with xyz file"""
with open("lih.xyz", "a") as file:
file.write("2\n 0 1\n Li 0.0 0.0 0.0\n H 0.0 0.0 1.2")
path = './lih.xyz'
check_file = os.path.exists(path)
if check_file == False:
with open("lih.xyz", "a") as file:
file.write("2\n 0 1\n Li 0.0 0.0 0.0\n H 0.0 0.0 1.2")
lih_ref_energy = -7.83561582555692
lih = Molecule(xyz_file="lih.xyz")
lih.run_pyscf()
Expand Down

0 comments on commit f6b5dbc

Please sign in to comment.