Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
javinoram committed May 8, 2024
1 parent 63cebca commit d655317
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/push_event_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push Event Workflow
name: Push Event Workflow 🐍

on: push

Expand All @@ -11,7 +11,9 @@ jobs:
uses : actions/checkout@v4

- name : Install Packages
run : pip install pytest
run : pip install -r requirements.txt

- name : Run tests
- name : Run tests hamiltonians
run : pytest tests/test.py

- name : Run tests convergency
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ pennylane-qiskit
qiskit_ibm_provider
pyyaml
networkx
basis-set-exchange
ipykernel
pennylane-lightning
jaxopt
optax
optax
Empty file added tests/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import pennylane as qml
from pennylane import numpy as np
from quantumsim.variational.vqe import vqe_spin, vqe_fermihubbard, vqe_molecular

#Test the hamiltonian of the h2 molecule
def test_hamiltonian_molecule():
#pennylane hamiltonian
elements=["H", "H"]
coord=np.array([0.0, 0.0, 0.0, 0.0, 0.0, 1.0])
H,q = qml.qchem.molecular_hamiltonian(elements, coord)

#vqepy class
Hvqe = vqe_molecular(elements, coord, {})
assert 1==1

#Test the hamiltonian of two spins 1/2
def test_hamiltonian_spin():
assert 1==1

#Test the hamiltonian of three sites
def test_hamiltonian_fh():
assert 1==1

0 comments on commit d655317

Please sign in to comment.