-
Notifications
You must be signed in to change notification settings - Fork 56
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
Internal modes #354
Open
DavidSPhillips
wants to merge
149
commits into
master
Choose a base branch
from
internal_modes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Internal modes #354
Changes from 119 commits
Commits
Show all changes
149 commits
Select commit
Hold shift + click to select a range
267f409
first commit on internal_modes, with first draft of pnr_prob function
jakeffbulmer d8f122d
make numba import consistent
jakeffbulmer e385563
add fully distinguishable functionality
jakeffbulmer 5ffa2e3
new name
jakeffbulmer 018fb6f
include __init__ file
jakeffbulmer ccdefb7
include single mode density matrix function
jakeffbulmer d0c6f33
missing import
jakeffbulmer 34f9196
adding functionality for preparing internal mode covariance matrices
jakeffbulmer 56dad89
starting to add tests
jakeffbulmer 3d219c9
new test comparing 3 methods for fully distinguishable GBS
jakeffbulmer 726132f
adding new tests for distinguishable gbs
jakeffbulmer ef34d39
adding tests for density_matrix_single_mode with GKP circuits
jakeffbulmer 86656b1
heralded density matrix test
jakeffbulmer 985a4d7
add some comments
jakeffbulmer 0aede73
not quite sure to be honest
jakeffbulmer e497213
fix prepare cov issues
jakeffbulmer 97300df
Bug fix found from other repo
DavidSPhillips faac228
Black reformatting
DavidSPhillips 736de0f
Adding weights to matrix orthonormalisation
DavidSPhillips 2561191
Making sure int32 arrays aren't causing problems in numba
DavidSPhillips 083aff0
Resolved merge conflict by using master version
DavidSPhillips 7ad6bf0
Ignoring all pycache folders
DavidSPhillips 4c4bcf9
Merge branch 'master' into internal_modes
DavidSPhillips b773ea1
Can herald density matrix in arbitrary spatial mode
DavidSPhillips 71f2f5d
Option to add LO overlaps added to density matrix
DavidSPhillips 042c537
Extra check added
DavidSPhillips a34fbbd
Addition of hbar as a kwarg where applicable
DavidSPhillips 264dc67
Further changes to make density matrix compatible with numba jit
DavidSPhillips 459c5b0
Removing pycache folder
DavidSPhillips ec3e04a
Further tidying up
DavidSPhillips d9b31c8
Merge branch 'master' into internal_modes
DavidSPhillips a4fbe8b
Fixing issue with svd conditon
DavidSPhillips 4c094f3
Moving LO overlap constraint check to non-jit function
DavidSPhillips 70f6c52
removing pycache
DavidSPhillips bd7439d
Merge branch 'master' into internal_modes
DavidSPhillips 9bf38f0
Merge branch 'master' into internal_modes
DavidSPhillips 8a88eab
Merge branch 'master' into internal_modes
DavidSPhillips 4ef6e43
Updating internal mode test functions with updates
DavidSPhillips 9fc7eee
Merge branch 'master' into internal_modes
DavidSPhillips 41df752
Removing strawberryfields dependency on test_internal_modes
DavidSPhillips 388aeba
Fixing global phase on eigendecomposition and Takagi
DavidSPhillips 833333d
Updating internal modes test functions
DavidSPhillips 88ab802
Fixing mistake in previous commits
DavidSPhillips 1bff0eb
Correcting decomposition issues and more real if close added
DavidSPhillips 4cee917
Takagi normalisation isn't going to work
DavidSPhillips f84cb57
Adding takagi decomposition similar to strawberryfields
DavidSPhillips ed92bb8
Tidying up
DavidSPhillips a1e1598
Adding test for new Takagi function in symplectic
DavidSPhillips 51c40a7
Adding autonne and takagi to autosummary
DavidSPhillips 865d7f6
Tests for orthonormal_basis and state_prep added
DavidSPhillips ba177ef
Adding test function for prepare_cov
DavidSPhillips 61c6b67
Readding sign convention to W matrices from Takagi output
DavidSPhillips 301405b
Further improvements to Takagi function
DavidSPhillips e419c3a
Updates to docstring for Takagi function
DavidSPhillips f2f11d6
Making location of test functions more obvious in test_internal_modes
DavidSPhillips 3aa4f4d
Moving Autonne and Takagi from symplectic to decompositions
DavidSPhillips c7d6561
Missing comma added
DavidSPhillips 0dfc3e5
Further missing commas added
DavidSPhillips 08fb4aa
Seeing if this solves the repoze.lru problem
DavidSPhillips 035cea9
Changing test internal modes takagi import to decompositions
DavidSPhillips c60d1b9
Removing typing conventions
DavidSPhillips 339cb2a
From itertools adding chain to test_internal_modes and groupby to dec…
DavidSPhillips e58dec3
Fixing issue that causes NaNs in takagi
DavidSPhillips 9b01d52
Fixing issue that causes NaNs in takagi in another place
DavidSPhillips 1680034
Fixing takagi not reversing order when false and changing np.conjugat…
DavidSPhillips f5984f0
Passes black in all the files
24dbcea
Making the linter a bit less unhappy
ed5b182
Making the linter a bit less unhappy
d5519ac
Making the linter a bit less unhappy
037deeb
Making the linter a bit less unhappy
5cfcd0a
Passing black
f7e8d28
Making the linter a bit less unhappy
5a4b040
Passing black
e691e18
Making pylint less unhappy
b80f951
Changes in _hafnian.py
61fb1a5
Changes atol
4084080
Passes black
02661b0
simplfies code
f58d3fc
passes black
b4a8587
minor changes
6171eab
minor changes
46d037f
Most test pass. Had to remove memoization in guan code function
936a99d
Passes black
4861386
Making the linter happy
745a6bc
Decreasing threshold for throwing vacuum modes away
DavidSPhillips da5016c
Making black happy
DavidSPhillips 1039bd9
Setting state prep thresh to 0 for tests
DavidSPhillips 100c522
Black again
DavidSPhillips 99c1c1d
Setting prepare cov threshold to 0 for tests
DavidSPhillips d839f09
Correcting error in previous commit
DavidSPhillips 20f4633
Fixing mistake in test density matrix
DavidSPhillips 2ca5d68
Changes to test density matrix
DavidSPhillips 55288b6
Changes to test density matrix again
DavidSPhillips df23fbf
Cutoff kwarg to test density matrix
DavidSPhillips 32193e2
Further changes to test density matrix
DavidSPhillips 3b2a749
Adding first test for Lowdin modes
DavidSPhillips 37228d3
Typo
DavidSPhillips 817905a
Adding test for finding LO overlaps with Lowdin modes
DavidSPhillips 40787cd
Adding test for finding density matrix in specific LO mode
DavidSPhillips f587a24
Adding extra import
DavidSPhillips 75f3800
Adding tqdm import
DavidSPhillips 36df0c1
Removing tqdm entirely
DavidSPhillips 245425d
Adding test for heradled single photon
DavidSPhillips 9ea0901
Some extra checks
DavidSPhillips 6b90010
Update thewalrus/internal_modes/prepare_cov.py
DavidSPhillips 3f1c540
Update thewalrus/internal_modes/prepare_cov.py
DavidSPhillips e45e8f6
Changing Q to cov for readability
DavidSPhillips 09c61a3
Further changes for clarity and reducing unnecessary calculations
DavidSPhillips 1ef13de
Using inbuilt function for 0), pack-reused 0
DavidSPhillips b0f124e
More changes for clarity and readability
DavidSPhillips b54ea57
Removing TODO as it's already done
DavidSPhillips 9dfe6ab
Fix in nb_binom for windows
DavidSPhillips ef3c9a4
Chaning the name of useful_tools to utils
DavidSPhillips a60154d
Making black happy
DavidSPhillips b3b6f17
Using beam_splitter and expand instead of writing explicit unitaries …
DavidSPhillips 6ffdb0f
Testing O matrix explicitly and adding more coverage for testing
DavidSPhillips 77e9981
Improving pylint
DavidSPhillips e6057ee
More things for pylint
DavidSPhillips 127189d
More pylint disabling for things that won't be changed
DavidSPhillips adfc7ab
Update thewalrus/internal_modes/distinguishable_pnr_prob.py
nquesada 98ece11
Internal modes update (#355)
rachelchadwick 801c741
Adding assertion tests to density_matrix_internal_modes
DavidSPhillips 691e74e
black
DavidSPhillips f7d7372
Adding assertion tests to orthonormal_basis
DavidSPhillips 439c7e4
Adding assertion tests to state_prep
DavidSPhillips 108eba7
Adding assertion tests to prepare_cov
DavidSPhillips ae971e6
Further codecov stuff
DavidSPhillips 9fae6be
Further codecov stuff again
DavidSPhillips 1370740
Setting normalize=False as default in internal modes desnity matrix
DavidSPhillips a3e2233
Running black through selected files
DavidSPhillips 90f017f
Normalising density matrices for tests
DavidSPhillips 5492942
Extra normalize added to test_mixed_heralded_photon
DavidSPhillips bb88521
Merge branch 'master' into internal_modes
DavidSPhillips 50696e3
Seeing if this solves black issue
DavidSPhillips 063fd4f
More black issues
DavidSPhillips 307e760
Merge branch 'master' into internal_modes
DavidSPhillips 0fc18b8
Merge branch 'master' into internal_modes
DavidSPhillips 8b67753
Merge branch 'master' into internal_modes
DavidSPhillips c625410
Merging master into internal_modes (#365)
nquesada e9c7d09
Merge branch 'master' into internal_modes
nquesada a00ca6d
Merge branch 'master' into internal_modes
nquesada ece2cb4
Merge branch 'master' into internal_modes
nquesada e6de063
Adding probability tests (#368)
nquesada 127a1a7
Merge branch 'master' into internal_modes
nquesada 7c63905
Merge branch 'master' into internal_modes
elib20 c390f84
Off diagonal (#383)
nquesada 7b227d8
fix segfaults
timmysilv f7358e6
add assert back as comment for posterity
timmysilv 2b249e9
Merge branch 'master' into internal_modes
RyosukeNORO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ numba==0.55.1 | |
numpy==1.21.5 | ||
scipy==1.8.0 | ||
sympy==1.10 | ||
repoze.lru>=0.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2022 Xanadu Quantum Technologies Inc. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
""" | ||
Functions to do internal modes/distinguishable GBS | ||
""" | ||
|
||
from .pnr_statistics import pnr_prob | ||
from .distinguishable_pnr_prob import distinguishable_pnr_prob | ||
from .fock_density_matrices import density_matrix_single_mode | ||
from .prepare_cov import * |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It hasn't been deleted, when I moved
autonne
here and addedtakagi
I moved the functions such that they're in alphabetical order. All is still there, just reordered.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was that necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that some other scripts had been orgnised in that way, so when I moved the functions I had the choice to just put them underneath or organise them in that way. I chose the latter.