Closed thisac closed 4 years ago
Merging #197 into master will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #197 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 20 +6
Lines 1087 1131 +44
=========================================
+ Hits 1087 1131 +44
Impacted Files | Coverage Δ | |
---|---|---|
thewalrus/__init__.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/__init__.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/adjacency_matrices.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/conversions.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/fock_tensors.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/gaussian_checks.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/means_and_variances.py | 100.00% <100.00%> (ø) |
|
thewalrus/quantum/photon_number_distributions.py | 100.00% <100.00%> (ø) |
|
... and 5 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 49f675b...82cd63f. Read the comment docs.
Look in the
quantum/__init__.py
file to get an overview for how the functions have been moved around.Context: The Walrus quantum module (
thewalrus.quantum
) is currently a bit unwieldy due to the large number of functions in the same file. It needs to be refactored to a package with better organization.Description of the Change:
thewalrus.quantum.py
is split up into several files collected in a folder/submodule namedquantum
. This folder contains the following files:fock_tensors.py
Set of functions for calculating various state representations, probabilities and classical subsystems of Gaussian states.adjacency_matrices.py
Functions for rescaling adjacency matrices as well as calculating the Qmat covariance matrix from an adjacency matrix.gaussian_state_tests.py
Tests for various properties of covariance matrices as well as fidelity calculations for Gaussian states.means_and_variances.py
Functions for constructing/calculating the means, variances and covariances of Gaussian states.photon_number_distributions.py
Functions for calculating the photon number distributions of various states.conversions.py
Functions for transforming one type of covariance-matrix-like object into another as well as reducing a Gaussian state.Furthermore, the following functions have been renamed, although the old names are still functional:
Means
->real_to_complex_displacements
Beta
->complex_to_real_displacements
prefactor
->_prefactor
gen_multi_mode_dist
->_convolve_squeezed_state_distribution
gen_single_mode_dist
->_squeezed_state_distribution
total_photon_num_dist_pure_state
->pure_state_distribution
Benefits: The quantum submodule is much cleaner and clearer. Everything works the same way as it did before, only the names are updated.
Possible Drawbacks: The function renaming shouldn't cause any issues since the old names still function, although removing the old names shouldn't either since neither TW nor SF seem to use any of the renamed functions.
There are currently no circular imports, although this could be an issue if adding more functions to these files. One has to be careful when doing so! :octocat:
Related GitHub Issues: N/A