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

Release v0.7.0 #336

Merged
merged 120 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 118 commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
31b651a
Update CI to agree with new dev policies 👩🏽‍⚖️ (#166)
sduquemesa Oct 14, 2022
4f9ade2
Sampling from Gaussian measurements 🎲 (#143)
sduquemesa Oct 17, 2022
30f8ce4
Rotation gate unitary (#155)
sduquemesa Oct 17, 2022
8265f89
Calculate displacement operator unitary matrix using The Walrus (#147)
sduquemesa Oct 17, 2022
39c8b4b
adds eye_like function to interface and tf backend (#170)
ziofil Oct 20, 2022
a3a238a
Refactor Wigner function into module (#171)
sduquemesa Nov 1, 2022
ff94a45
Bugfix dgate gradient (#176)
ziofil Nov 10, 2022
318c9ab
settings repr (#174)
ziofil Nov 11, 2022
555c6a6
Refactor `utils.homodyne` into `physics.fock` (#177)
sduquemesa Nov 17, 2022
c984ed1
Use marginal distribution when drawing 🎨 (#179)
sduquemesa Nov 24, 2022
5d72b0e
optional callback at each opt step (#175)
ziofil Dec 5, 2022
fc3dfec
Bugfix rgate modes (#180)
ziofil Dec 13, 2022
4dc12a3
allows for full cutoff specification (#181)
ziofil Dec 13, 2022
7fb563b
changes norm to probability in repr of State (#182)
ziofil Dec 13, 2022
2f474c3
Choi application bugfix (#188)
ziofil Jan 9, 2023
3ff0cab
Check changelog entry is created on PRs (#189)
sduquemesa Jan 10, 2023
0655361
Seed (#183)
ziofil Jan 11, 2023
1a1a314
Fock cutoff bugfix (#184)
ziofil Jan 11, 2023
7511b95
fix max int32
ziofil Jan 12, 2023
aa9be5e
Bargmann methods (#185)
ziofil Jan 13, 2023
44650f0
Bugfix axis labels (#190)
ziofil Jan 17, 2023
a9d6ddb
Bugfix typerror (#192)
ziofil Jan 20, 2023
f856be7
blacked (#197)
ziofil Feb 3, 2023
8f17c23
Adds ray-based distributed trainer. (#194)
zeyueN Feb 9, 2023
b135bf7
Circuit drawer (#196)
ziofil Feb 11, 2023
a69fff2
updated README.md
ziofil Feb 16, 2023
7d79a37
ray test fix (#201)
zeyueN Feb 17, 2023
8f6d70d
Improving tests (#191)
ziofil Feb 27, 2023
2b9b182
Compact fock (#154)
rdprins Feb 28, 2023
a95c987
Bugfix misc (#202)
ziofil Feb 28, 2023
df42771
Improve mmtensor (#195)
ziofil Feb 28, 2023
b936c39
displays sign correctly (#209)
ziofil Feb 28, 2023
fbc1614
better type annotations (#199)
ziofil Feb 28, 2023
4fa732d
Add unitary update (#208)
sylviemonet Mar 1, 2023
adda279
fix issue and add test (#210)
ziofil Mar 1, 2023
ad74f57
dm-dm fidelity cutoffs (#212)
ziofil Mar 1, 2023
ff1c947
Displacement gate on MrMustard (#211)
sduquemesa Mar 3, 2023
f24e3a4
Bump version and get changelog ready for release (#213)
ziofil Mar 3, 2023
3582c5a
Dockerize Mr Mustard and create vscode dev-container (#214)
sduquemesa Mar 6, 2023
1eab73f
Choi cutoff fix (#216)
ziofil Mar 7, 2023
a84bb6e
Update requirements (#215)
sduquemesa Mar 7, 2023
af67a53
Fix build action on main branch
sduquemesa Mar 7, 2023
4030c8d
Merge branch 'main' into develop
ziofil Mar 8, 2023
849c1ee
Increment version to 0.5.0-dev (#220)
sduquemesa Mar 8, 2023
8fbaaeb
Merge branch 'develop' of github.com:XanaduAI/MrMustard into develop
ziofil Mar 8, 2023
37270fc
Merge branch 'develop' of github.com:XanaduAI/MrMustard into develop
ziofil Mar 8, 2023
f75dd50
Merge branch 'main' into develop
elib20 Mar 11, 2023
1abad67
Improve callbacks and adds tensorboard (#219)
zeyueN Mar 11, 2023
1335802
Merge branch 'main' into develop
ziofil Mar 24, 2023
6349d30
Modular fock strategies (#235)
ziofil Apr 13, 2023
c736dc3
More strategies (#239)
ziofil May 31, 2023
ebbdd3c
bugfix, test and changelog entry (#246)
ziofil May 31, 2023
c84ee68
Stable BSgate (#248)
ziofil Jun 20, 2023
7bbddbf
Compact fock correction (#249)
rdprins Jun 23, 2023
73b2af6
Bugfix gradients (#253)
ziofil Jun 27, 2023
1f5762d
Migration to Poetry (#257)
ggulli Jul 18, 2023
fcb9512
Release v050 (#264)
ziofil Jul 26, 2023
db19ab6
Bump version to `0.6.0-dev` (#267)
sduquemesa Jul 31, 2023
f5ee767
fix the variable name in apply choi (#271)
sylviemonet Aug 30, 2023
d686fe7
New phase noise (#275)
ziofil Sep 29, 2023
d82b936
Ensuring that hbar can only be specified in `Settings` (#273)
Sep 29, 2023
0a02b4c
Freezing settings after their values are used (#278)
Oct 2, 2023
9adb311
ABC related modifications (#255)
sylviemonet Oct 6, 2023
1935a4f
Implementing new discretization method for Wigner functions (#276)
Oct 6, 2023
a4fbee5
Fixing a bug in `choi` (#283)
Oct 12, 2023
95752f3
bumps tensorflow version to v2.14 (#281)
zeyueN Oct 13, 2023
37fd238
Develop tn (#287)
Oct 17, 2023
41b500f
Vanilla strategy with complex512 (using Julia) (#274)
rdprins Oct 18, 2023
0ff155e
Merge branch 'develop'
ziofil Oct 18, 2023
4d25c44
fix version name
ziofil Oct 18, 2023
a48cfed
Fixing bug in develop (#291)
Oct 18, 2023
0504a12
Removing circular dependencies (#289)
Oct 20, 2023
5d22535
fix types
ziofil Oct 23, 2023
ebe7489
remove force_settings
ziofil Oct 23, 2023
812ba7a
better math
ziofil Oct 23, 2023
89da45a
fix calls
ziofil Oct 23, 2023
be7f62c
Fix inconsistent atol in purity evaluation for Gaussian states. (#294)
jan-provaznik Oct 26, 2023
a4f126b
Diagonal strategy with higher precision (using Julia) (#288)
rdprins Oct 27, 2023
34439fc
Constants and variables (#298)
Oct 27, 2023
b5975f6
FIxes push to dev branch (#297)
ziofil Oct 29, 2023
ac1509d
Update docs about installing Julia (#290)
rdprins Oct 30, 2023
fdd6e85
Skipping Julia tests if Julia is not installed. (#299)
Oct 31, 2023
591e609
Adding backend interface and numpy backend to Mr Mustard (#301)
Nov 3, 2023
22cf494
include julia_pkg in python packaging (#303)
zeyueN Nov 10, 2023
77dfff6
Use importlib for version (#304)
zeyueN Nov 10, 2023
fba4c72
fix the document about functions loss_XYd and amp_XYd (#305)
sylviemonet Nov 17, 2023
4aaa320
Remove warnings at the root (#307)
Nov 27, 2023
c1ea33d
Add batch in recursive relation (#308)
sylviemonet Nov 28, 2023
be00ad7
Switching from `np.empty` to `np.zeros` (#309)
Nov 29, 2023
d6a9c32
fix_types (#310)
ziofil Nov 29, 2023
fd82ccb
Cleaning up the backend manager (#311)
Dec 5, 2023
dcd2395
Linearizing the vanilla algorithm (#312)
Dec 6, 2023
ac4ae6a
Simplifying tests for compact fock file (#313)
Dec 7, 2023
188088c
Add cutoff for states in test_state (#315)
sylviemonet Dec 11, 2023
552b8d8
Speeding up `vanilla_vjp` (#318)
Dec 14, 2023
4cb1fd7
Bargmann method physics (#295)
ziofil Jan 11, 2024
774681f
Silencing TensorFlow warning (#332)
Feb 1, 2024
e800c29
done
SamFerracin Feb 1, 2024
796d4b2
bump ray
SamFerracin Feb 1, 2024
fd4323f
empty
SamFerracin Feb 1, 2024
836796d
grpcio
SamFerracin Feb 1, 2024
edf01a7
trivy
SamFerracin Feb 1, 2024
f348c97
CR
SamFerracin Feb 1, 2024
07969f4
Merge branch 'main' of https://github.com/XanaduAI/MrMustard into rel…
SamFerracin Feb 2, 2024
7368cb2
build
SamFerracin Feb 2, 2024
a0a1adb
build
SamFerracin Feb 2, 2024
5f31f98
done
SamFerracin Feb 2, 2024
4673f6b
changelog
SamFerracin Feb 2, 2024
cd1256e
black
SamFerracin Feb 2, 2024
4174777
trivy
SamFerracin Feb 2, 2024
d32b482
dependencies
SamFerracin Feb 2, 2024
4da4224
poetry
SamFerracin Feb 2, 2024
00cac30
updating pytest to prevent CVE-2022-42969
SamFerracin Feb 2, 2024
32b28b2
sync
SamFerracin Feb 2, 2024
2c44d8e
changelog conflict
SamFerracin Feb 2, 2024
2258ce9
walrus bump
SamFerracin Feb 2, 2024
96ea206
Fixing a Scipy error (#337)
Feb 2, 2024
d1bfd96
Merge branch 'develop' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Feb 2, 2024
429b16c
Removing TF warnings on import with `os` instead of `logging` (#339)
Feb 6, 2024
43d27ca
Merge branch 'develop' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Feb 6, 2024
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
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"context": "..",
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/julialang/devcontainer-features/julia:1": {
"channel": "1.9.3"
}
},
"postCreateCommand": "/bin/zsh ./.devcontainer/post-install.sh",
"customizations": {
"vscode": {
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#! /bin/zsh

poetry install --all-extras --with dev,doc
julia --project="julia_pkg" -e "using Pkg; Pkg.instantiate()"
152 changes: 134 additions & 18 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,123 @@
# Release 0.6.1-post1 (current release)
# Release 0.7.0 (current release)

### New features
* Added a new interface for backends, as well as a `numpy` backend (which is now default). Users can run
all the functions in the `utils`, `math`, `physics`, and `lab` with both backends, while `training`
requires using `tensorflow`. The `numpy` backend provides significant improvements both in import
time and runtime. [(#301)](https://github.com/XanaduAI/MrMustard/pull/301)

* Added the classes and methods to create, contract, and draw tensor networks with `mrmustard.math`.
[(#284)](https://github.com/XanaduAI/MrMustard/pull/284)

* Added functions in physics.bargmann to join and contract (A,b,c) triples.
[(#295)](https://github.com/XanaduAI/MrMustard/pull/295)

* Added an Ansatz abstract class and PolyExpAnsatz concrete implementation. This is used in the Bargmann representation.
[(#295)](https://github.com/XanaduAI/MrMustard/pull/295)

* Added `complex_gaussian_integral` method.
[(#295)](https://github.com/XanaduAI/MrMustard/pull/295)

* Added `Bargmann` representation (parametrized by Abc). Supports all algebraic operations and CV (exact) inner product.
[(#296)](https://github.com/XanaduAI/MrMustard/pull/296)

### Breaking changes
* Removed circular dependencies by:
* Removing `graphics.py`--moved `ProgressBar` to `training` and `mikkel_plot` to `lab`.
* Moving `circuit_drawer` and `wigner` to `physics`.
* Moving `xptensor` to `math`.
[(#289)](https://github.com/XanaduAI/MrMustard/pull/289)

* Created `settings.py` file to host `Settings`.
[(#289)](https://github.com/XanaduAI/MrMustard/pull/289)

* Moved `settings.py`, `logger.py`, and `typing.py` to `utils`.
[(#289)](https://github.com/XanaduAI/MrMustard/pull/289)

* Removed the `Math` class. To use the mathematical backend, replace
`from mrmustard.math import Math ; math = Math()` with `import mrmustard.math as math`
in your scripts.
[(#301)](https://github.com/XanaduAI/MrMustard/pull/301)

* The `numpy` backend is now default. To switch to the `tensorflow`
backend, add the line `math.change_backend("tensorflow")` to your scripts.
[(#301)](https://github.com/XanaduAI/MrMustard/pull/301)

### Improvements

* Relaxes dependency versions in pyproject.toml. More specifically, this is to unpin scipy.
[(#300)](https://github.com/XanaduAI/MrMustard/pull/300)
* Calculating Fock representations and their gradients is now more numerically stable (i.e. numerical blowups that
result from repeatedly applying the recurrence relation are postponed to higher cutoff values).
This holds for both the "vanilla strategy" [(#274)](https://github.com/XanaduAI/MrMustard/pull/274) and for the
"diagonal strategy" and "single leftover mode strategy" [(#288)](https://github.com/XanaduAI/MrMustard/pull/288/).
This is done by representing Fock amplitudes with a higher precision than complex128 (countering floating-point errors).
We run Julia code via PyJulia (where Numba was used before) to keep the code fast.
The precision is controlled by `setting settings.PRECISION_BITS_HERMITE_POLY`. The default value is ``128``,
which uses the old Numba code. When setting to a higher value, the new Julia code is run.

* Replaced parameters in `training` with `Constant` and `Variable` classes.
[(#298)](https://github.com/XanaduAI/MrMustard/pull/298)

* Improved how states, transformations, and detectors deal with parameters by replacing the `Parametrized` class with `ParameterSet`.
[(#298)](https://github.com/XanaduAI/MrMustard/pull/298)

* Includes julia dependencies into the python packaging for downstream installation reproducibility.
Removes dependency on tomli to load pyproject.toml for version info, uses importlib.metadata instead.
[(#303)](https://github.com/XanaduAI/MrMustard/pull/303)
[(#304)](https://github.com/XanaduAI/MrMustard/pull/304)

* Improves the algorithms implemented in `vanilla` and `vanilla_vjp` to achieve a speedup.
Specifically, the improved algorithms work on flattened arrays (which are reshaped before being returned) as opposed to multi-dimensional array.
[(#312)](https://github.com/XanaduAI/MrMustard/pull/312)
[(#318)](https://github.com/XanaduAI/MrMustard/pull/318)

* Adds functions `hermite_renormalized_batch` and `hermite_renormalized_diagonal_batch` to speed up calculating
Hermite polynomials over a batch of B vectors.
[(#308)](https://github.com/XanaduAI/MrMustard/pull/308)

* Added suite to filter undesired warnings, and used it to filter tensorflow's ``ComplexWarning``s.
[(#332)](https://github.com/XanaduAI/MrMustard/pull/332)


### Bug fixes

* Added the missing `shape` input parameters to all methods `U` in the `gates.py` file.
[(#291)](https://github.com/XanaduAI/MrMustard/pull/291)
* Fixed inconsistent use of `atol` in purity evaluation for Gaussian states.
[(#294)](https://github.com/XanaduAI/MrMustard/pull/294)
* Fixed the documentations for loss_XYd and amp_XYd functions for Gaussian channels.
[(#305)](https://github.com/XanaduAI/MrMustard/pull/305)
* Replaced all instances of `np.empty` with `np.zeros` to fix instabilities.
[(#309)](https://github.com/XanaduAI/MrMustard/pull/309)
* Fixing a bug where `scipy.linalg.sqrtm` returns an unsupported type.
[(#337)](https://github.com/XanaduAI/MrMustard/pull/337)

### Documentation

### Tests
* Added tests for calculating Fock amplitudes with a higher precision than `complex128`.

### Contributors
[Eli Bourassa](https://github.com/elib20),
[Robbe De Prins](https://github.com/rdprins),
[Samuele Ferracin](https://github.com/SamFerracin),
[Jan Provaznik](https://github.com/jan-provaznik),
[Yuan Yao](https://github.com/sylviemonet)
[Filippo Miatto](https://github.com/ziofil)


---

# Release 0.6.1-post1

### Improvements

* Relaxes dependency versions in pyproject.toml. More specifically, this is to unpin scipy.
[(#300)](https://github.com/XanaduAI/MrMustard/pull/300)

### Contributors
[Filippo Miatto](https://github.com/ziofil), [Samuele Ferracin](https://github.com/SamFerracin), [Yuan Yao](https://github.com/sylviemonet), [Zeyue Niu](https://github.com/zeyueN)


---
# Release 0.6.0

Expand All @@ -30,25 +129,36 @@ can select their preferred methods by setting the value of `Settings.DISCRETIZAT
`clenshaw`.
[(#280)](https://github.com/XanaduAI/MrMustard/pull/280)

* Added the `PhaseNoise(phase_stdev)` gate (non-Gaussian). Output is a mixed state in Fock representation.
It is not based on a choi operator, but on a nonlinear transformation of the density matrix.
* Added the `PhaseNoise(phase_stdev)` gate (non-Gaussian). Output is a mixed state in Fock representation. It is not based on a choi operator, but on a nonlinear transformation of the density matrix.
[(#275)](https://github.com/XanaduAI/MrMustard/pull/275)

### Breaking changes

* The value of `hbar` can no longer be specified outside of `Settings`. All the classes and
methods that allowed specifying its value as an input now retrieve it directly from `Settings`.
[(#278)](https://github.com/XanaduAI/MrMustard/pull/278)
[(#273)](https://github.com/XanaduAI/MrMustard/pull/273)

* Certain attributes of `Settings` can no longer be changed after their value is queried for the
first time.
[(#278)](https://github.com/XanaduAI/MrMustard/pull/278)
* Certain attributes of `Settings` can no longer be changed after their value is queried for the first time.
[(#273)](https://github.com/XanaduAI/MrMustard/pull/273)

### Improvements

* Calculating Fock representations using the "vanilla strategy" is now more numerically stable (i.e. numerical blowups
that result from repeatedly applying the recurrence relation are now postponed to higher cutoff values).
This is done by representing Fock amplitudes with a higher precision than complex128
(which counters the accumulation of floating-point errors).
We run Julia code via PyJulia (where Numba was used before) to keep the code fast.
[(#274)](https://github.com/XanaduAI/MrMustard/pull/274)

* Tensorflow bumped to v2.14 with poetry installation working out of the box on Linux and Mac.
[(#281)](https://github.com/XanaduAI/MrMustard/pull/281)

* Incorporated `Tensor` into `Transformation` in order to deal with modes more robustly.
[(#287)](https://github.com/XanaduAI/MrMustard/pull/287)

* Created the classes `Unitary` and `Channel` to simplify the logic in `Transformation`.
[(#287)](https://github.com/XanaduAI/MrMustard/pull/287)

### Bug fixes

* Fixed a bug about the variable names in functions (apply_kraus_to_ket, apply_kraus_to_dm, apply_choi_to_ket, apply_choi_to_dm).
Expand All @@ -57,17 +167,19 @@ can select their preferred methods by setting the value of `Settings.DISCRETIZAT
* Fixed a bug that was leading to an error when computing the Choi representation of a unitary transformation.
[(#283)](https://github.com/XanaduAI/MrMustard/pull/283)

* Fixed the internal function to calculate ABC of Bargmann representation (now corresponds to the literature) and other fixes to get the correct Fock tensor.
[(#255)](https://github.com/XanaduAI/MrMustard/pull/255)

### Documentation

### Contributors
[Filippo Miatto](https://github.com/ziofil), [Samuele Ferracin](https://github.com/SamFerracin), [Yuan Yao](https://github.com/sylviemonet), [Zeyue Niu](https://github.com/zeyueN)
[Filippo Miatto](https://github.com/ziofil),
[Yuan Yao](https://github.com/sylviemonet),
[Robbe De Prins](https://github.com/rdprins),
[Samuele Ferracin](https://github.com/SamFerracin)
[Zeyue Niu](https://github.com/zeyueN)


---

# Release 0.5.0
# Release 0.5.0

### New features

Expand All @@ -88,7 +200,6 @@ can select their preferred methods by setting the value of `Settings.DISCRETIZAT

def cost_fn():
...

def as_dB(cost):
delta = np.sqrt(np.log(1 / (abs(cost) ** 2)) / (2 * np.pi))
cost_dB = -10 * np.log10(delta**2)
Expand Down Expand Up @@ -151,7 +262,6 @@ can select their preferred methods by setting the value of `Settings.DISCRETIZAT
[(#239)](https://github.com/XanaduAI/MrMustard/pull/239)

* More robust implementation of cutoffs for States.

[(#239)](https://github.com/XanaduAI/MrMustard/pull/239)

* Dependencies and versioning are now managed using Poetry.
Expand All @@ -178,6 +288,7 @@ cutoff of the first detector is equal to 1, the resulting density matrix is now
[Robbe De Prins](https://github.com/rdprins), [Gabriele Gullì](https://github.com/ggulli),
[Richard A. Wolf](https://github.com/ryk-wolf)


---

# Release 0.4.1
Expand Down Expand Up @@ -207,7 +318,7 @@ cutoff of the first detector is equal to 1, the resulting density matrix is now

---

# Release 0.4.0 (current release)
# Release 0.4.0

### New features

Expand Down Expand Up @@ -450,6 +561,7 @@ This release contains contributions from (in alphabetical order):
[Filippo Miatto](https://github.com/ziofil), [Zeyue Niu](https://github.com/zeyueN),
[Yuan Yao](https://github.com/sylviemonet)


---

# Release 0.3.0
Expand Down Expand Up @@ -605,7 +717,6 @@ This release contains contributions from (in alphabetical order):
[Mikhail Andrenkov](https://github.com/Mandrenkov), [Sebastian Duque Mesa](https://github.com/sduquemesa), [Filippo Miatto](https://github.com/ziofil), [Yuan Yao](https://github.com/sylviemonet)



---

# Release 0.2.0
Expand Down Expand Up @@ -656,6 +767,8 @@ This release contains contributions from (in alphabetical order):
[Filippo Miatto](https://github.com/ziofil)


---

# Release 0.1.1

### New features since last release
Expand Down Expand Up @@ -704,6 +817,8 @@ This release contains contributions from (in alphabetical order):
[Sebastián Duque](https://github.com/sduquemesa), [Filippo Miatto](https://github.com/ziofil)


---

# Release 0.1.0

### New features since last release
Expand All @@ -717,3 +832,4 @@ This release contains contributions from (in alphabetical order):
[Sebastián Duque](https://github.com/sduquemesa), [Zhi Han](https://github.com/hanzhihua1),
[Theodor Isacsson](https://github.com/thisac/), [Josh Izaac](https://github.com/josh146),
[Filippo Miatto](https://github.com/ziofil), [Nicolas Quesada](https://github.com/nquesada)

8 changes: 8 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,13 @@ jobs:
- name: Install only test dependencies
run: poetry install --no-root --extras "ray" --with dev

- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: 1.9.3

- name: Setup Julia part 2
run: julia --project="julia_pkg" -e "using Pkg; Pkg.instantiate()"

- name: Run tests
run: python -m pytest tests -p no:warnings --tb=native
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Numpy tests
on:
push:
branches:
Expand Down Expand Up @@ -30,18 +30,18 @@ jobs:
with:
python-version: '3.9'

- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: 1.9.3

- name: Install dependencies
run: |
python -m pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir poetry==1.4.0
poetry config virtualenvs.create false
poetry install --extras "ray" --with dev
julia --project="julia_pkg" -e "using Pkg; Pkg.instantiate()"

- name: Run tests
run: python -m pytest tests --cov=mrmustard --cov-report=term-missing --cov-report=xml -p no:warnings --tb=native

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: true
run: python -m pytest tests --backend=numpy -p no:warnings --tb=native
53 changes: 53 additions & 0 deletions .github/workflows/tests_tensorflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tensorflow tests
on:
push:
branches:
- develop
pull_request:
paths:
- '.github/workflows/tests.yml'
- 'mrmustard/**'
- 'tests/**'
- 'pyproject.toml'
- 'poetry.lock'
- 'pytest.ini'

jobs:
pytest:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
HYPOTHESIS_PROFILE: ci

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: 1.9.3

- name: Install dependencies
run: |
python -m pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir poetry==1.4.0
poetry config virtualenvs.create false
poetry install --extras "ray" --with dev
julia --project="julia_pkg" -e "using Pkg; Pkg.instantiate()"

- name: Run tests
run: python -m pytest tests --backend=tensorflow --cov=mrmustard --cov-report=term-missing --cov-report=xml -p no:warnings --tb=native

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ ignored-classes=numpy,tensorflow,scipy,networkx,strawberryfields,thewalrus
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
disable=no-member,line-too-long,invalid-name,too-many-lines,redefined-builtin,too-many-locals,duplicate-code,too-many-arguments,too-few-public-methods,no-else-return,isinstance-second-argument-not-valid-type
disable=no-member,line-too-long,invalid-name,too-many-lines,redefined-builtin,too-many-locals,duplicate-code,too-many-arguments,too-few-public-methods,no-else-return,isinstance-second-argument-not-valid-type,no-self-argument
Loading
Loading