Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update interface + add CI/CD config #7

Merged
merged 7 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI
# Run on main, any tag or any pull request
on:
pull_request:
branches:
- main
push:
branches:
- main
tags: '*'

concurrency:
# cancel in progress builds for pull requests
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startswith(github.ref, 'refs/pull/') }}

jobs:
os-test:
runs-on: ${{ matrix.os }}
# don't run on draft PRs
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# allow windows to fail
strategy:
fail-fast: true
max-parallel: 2
matrix:
os: [macOS-latest]
arch: ['x64']
steps:
- uses: actions/checkout@v1
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: 1.9
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
version-test:
runs-on: ubuntu-latest
# don't run on draft PRs
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# allow failures on nightly or beta Julia
continue-on-error: ${{ matrix.version == 'nightly'}}
strategy:
fail-fast: true
max-parallel: 2
matrix:
version: ['1.9', '1.10', 'nightly']
arch: ['x64']
steps:
- uses: actions/checkout@v1
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
- name: "Process coverage"
uses: julia-actions/julia-processcoverage@v1
with:
directories: src
- name: "Upload coverage"
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
needs: [os-test, version-test]
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
13 changes: 12 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
name = "BraketAHS"
uuid = "aad1d28c-1a3f-47da-806d-2ed76430c1d6"
authors = ["Yaroslav Kharkov", "Katharine Hyatt"]
version = "0.0.1"


[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -6,9 +12,14 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Braket = "19504a0f-b47d-4348-9127-acc6cc69ef67"
Braket = "19504a0f-b47d-4348-9127-acc6cc69ef67"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ julia --project=. -e 'using Pkg; Pkg.instantiate()'
### Running MPS-based simulation
1. To run the Braket-AHS program saved as a .json file run:
```
julia mps_runner.jl --program-path=<path_to_ahs.json>
julia src/mps_runner.jl --program-path=<path_to_ahs.json>
```

In order to generate .json configuration file there are 2 options:
Expand All @@ -54,7 +54,7 @@ with open(filename, "w") as json_file:
Example .json config files are provided in `examples/ahs_program*.json`.

#### The required input argument is:
* `--program-path`: specifies the path to AHS program .json file (example file is provided `./ahs_program.json`)
* `--program-path`: specifies the path to AHS program .json file (example file is provided `examples/ahs_program.json`)

#### The optional arguments are:
* `--experiment-path`: directory where all experiment results are saved (default is `examples/experiment_braket`).
Expand Down Expand Up @@ -86,6 +86,6 @@ Output files from MPS simulaiton are stored in `<experiment_path>`:

To run visualization script run:
```
julia plotter.jl <path_to_experiment_results>
julia src/plotter.jl <path_to_experiment_results>
```
It will generate plots from the .csv files saved in <path_to_experiment_results>.
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
BraketAHS = "aad1d28c-1a3f-47da-806d-2ed76430c1d6"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
23 changes: 23 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using BraketAHS
using Documenter

DocMeta.setdocmeta!(BraketAHS, :DocTestSetup, :(using BraketAHS); recursive=true)

makedocs(;
modules=[BraketAHS],
authors="Yaroslav Kharkov, Katharine Hyatt",
sitename="BraketAHS.jl",
format=Documenter.HTML(;
canonical="https://ykharkov.github.io/BraketAHS.jl",
edit_link="main",
assets=String[],
),
pages=[
"Home" => "index.md",
],
)

deploydocs(;
repo="github.com/ykharkov/BraketAHS.jl",
devbranch="main",
)
14 changes: 14 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```@meta
CurrentModule = BraketAHS
```

# BraketAHS

Documentation for [BraketAHS](https://github.com/ykharkov/BraketAHS.jl).

```@index
```

```@autodocs
Modules = [BraketAHS]
```
180 changes: 0 additions & 180 deletions mps_runner.jl

This file was deleted.

Loading
Loading