Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #25 from zapatacomputing/dev
Browse files Browse the repository at this point in the history
Merge dev to main
  • Loading branch information
mstechly authored Apr 22, 2022
2 parents 6441aad + 6efdb83 commit 57c8171
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
################################################################################
# © Copyright 2021-2022 Zapata Computing Inc.
################################################################################
include subtrees/z_quantum_actions/Makefile

github_actions:
python3 -m venv ${VENV} && \
${VENV}/bin/python3 -m pip install --upgrade pip && \
${VENV}/bin/python3 -m pip install ./z-quantum-core && \
${VENV}/bin/python3 -m pip install -e '.[develop]'


build-system-deps:
$(PYTHON) -m pip install setuptools wheel "setuptools_scm>=6.0"
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2021-2022 Zapata Computing Inc.
################################################################################
import site
import sys
import warnings
Expand Down
3 changes: 3 additions & 0 deletions src/python/zquantum/solid_state/fermi_hubbard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2020-2022 Zapata Computing Inc.
################################################################################
import numpy as np
import scipy
import scipy.integrate as integrate
Expand Down
3 changes: 3 additions & 0 deletions src/python/zquantum/solid_state/generate_hamiltonians.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2020-2022 Zapata Computing Inc.
################################################################################
"""Module to generate 1D FHM Hamiltonians at half-filling."""

import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions steps/fermi_hubbard_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2020-2021 Zapata Computing Inc.
################################################################################
from typing import Optional

from zquantum.core.openfermion import save_interaction_operator
Expand Down
6 changes: 6 additions & 0 deletions subtrees/z_quantum_actions/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2021-2022 Zapata Computing Inc.
################################################################################
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
include $(TOP_DIR)/variables.mk

Expand Down Expand Up @@ -82,6 +85,9 @@ style-default: flake8 mypy black isort
muster-default: style coverage
@echo This project passes muster!

build-system-deps-default:
:

# This is what converts the -default targets into base target names.
# Do not remove!!!
%: %-default
Expand Down
40 changes: 37 additions & 3 deletions subtrees/z_quantum_actions/actions/publish-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,46 @@ runs:
git push --tags
echo "::set-output name=tag::$TAG"
# Use pip to build a PEP 517 wheel
- name: Build wheel
id: build-wheel
shell: bash
run: python3 -m pip wheel --isolated --no-deps -w dist .

# Upload all artifacts in dist
- name: Store wheel artifacts
uses: actions/upload-artifact@v2
with:
name: Python Wheels
path: dist

- name: Create entry on GH Releases
id: make-release
shell: bash
run: |
curl \
# When we make a release, we should check the response for the "upload_url"
API_RESPONSE=$(curl \
-X POST \
curl -H "Authorization: token ${{ github.token }}" \
-H "Authorization: token ${{ github.token }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{"tag_name":"${{ steps.push-new-version-tag.outputs.tag }}"}'
-d '{"tag_name":"${{ steps.push-new-version-tag.outputs.tag }}"}')
# The URL from github has some extras in curly brackets that we do not want:
# The URL always ends in assets, so we can use that to help check for the end
UPLOAD_URL=$(echo ${API_RESPONSE} | jq .upload_url | sed "s/\(.*assets\){.*}/\1/")
echo "::set-output name=upload_url::${UPLOAD_URL}"
- name: Upload wheel to release page
shell: bash
run: |
# We don't know the wheel name, so we can check for everything in the dist dir
# We may build multiple wheels from a single repo, so this works for that too.
for wheel in dist/*; do
curl \
-X POST \
-H "Authorization: token ${{ github.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: $(file -b --mime-type $wheel)" \
-T "$wheel" \
"${{ steps.make-release.outputs.upload_url }}?name=$(basename $wheel)"
done
3 changes: 3 additions & 0 deletions subtrees/z_quantum_actions/bin/get_next_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#! /usr/bin/env python3
################################################################################
# © Copyright 2022 Zapata Computing Inc.
################################################################################

# This script ia intended to be run from within a Github Action.
# Reads current project version, bumps "minor", and sets the "next_version" output
Expand Down
3 changes: 3 additions & 0 deletions subtrees/z_quantum_actions/sample_setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python
################################################################################
# © Copyright 2021-2022 Zapata Computing Inc.
################################################################################

import site
import sys
Expand Down
3 changes: 3 additions & 0 deletions subtrees/z_quantum_actions/setup_extras.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2021-2022 Zapata Computing Inc.
################################################################################
extras = {
# Development extras needed in every project, because the stylechecks depend on it.
# If you need more dev deps, extend this list in your own setup.py.
Expand Down
3 changes: 3 additions & 0 deletions subtrees/z_quantum_actions/tests/test_get_next_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2022 Zapata Computing Inc.
################################################################################
import re
import subprocess

Expand Down
3 changes: 3 additions & 0 deletions tests/zquantum/solid_state/fermi_hubbard_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
################################################################################
# © Copyright 2021-2022 Zapata Computing Inc.
################################################################################
import unittest

from zquantum.core.openfermion import FermionOperator, get_interaction_operator
Expand Down

0 comments on commit 57c8171

Please sign in to comment.