Skip to content

Commit

Permalink
Merge pull request #33 from qsimulate/github-actions
Browse files Browse the repository at this point in the history
Add github actions workflow
  • Loading branch information
JProvazza authored Feb 2, 2024
2 parents d2543b8 + 9ef67b4 commit fc9e607
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install with dependencies
env:
MKLROOT: ~/.local
run: |
python -m pip install --upgrade pip
pip install mkl==2021.4 mkl-include
pip install --extra-index-url=https://block-hczhai.github.io/pyblock3-preview/pypi/ .
- name: fix mkl for amd cpu
run: |
lscpu
export CPUTYPE=$(lscpu | grep 'Vendor ID' | awk '{print $3}')
echo $CPUTYPE
if [ "$CPUTYPE" = "AuthenticAMD" ]; then
echo "int mkl_serv_intel_cpu_true() { return 1; }" > fixcpu.c
gcc -shared -fPIC -o libfixcpu.so fixcpu.c
fi
getconf LONG_BIT
- name: Test with pytest
env:
MKLROOT: ~/.local
run: |
export CPUTYPE=$(lscpu | grep 'Vendor ID' | awk '{print $3}')
if [ "$CPUTYPE" = "AuthenticAMD" ]; then
export LD_PRELOAD=$PWD/libfixcpu.so
fi
pip install openfermionpyscf
pip install pytest
pytest tests
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# MPS-FQE
The Matrix Product State Fermionic Quantum Emulator (MPS-FQE) delivers a matrix product state backend to the [Openfermion-FQE](https://github.com/quantumlib/OpenFermion-FQE) fermionic circuit simulator.

[![Tests](https://github.com/qsimulate/MPS-FQE/workflows/Tests/badge.svg)](https://github.com/qsimulate/MPS-FQE/actions/workflows/test.yml)

## Getting Started
Installing MPS-FQE can be done by executing the `install.sh` script in the current directory.

Expand Down

0 comments on commit fc9e607

Please sign in to comment.