Release 0.16.0
New features since last release
-
Adds the ability to construct time domain multiplexing algorithms via the new
sf.TDMProgram
class, for highly scalable simulation of Gaussian states. (#440)For example, creating and simulating a time domain program with 2 concurrent modes:
>>> import strawberryfields as sf >>> from strawberryfields import ops >>> prog = sf.TDMProgram(N=2) >>> with prog.context([1, 2], [3, 4], copies=3) as (p, q): ... ops.Sgate(0.7, 0) | q[1] ... ops.BSgate(p[0]) | (q[0], q[1]) ... ops.MeasureHomodyne(p[1]) | q[0] >>> eng = sf.Engine("gaussian") >>> results = eng.run(prog) >>> print(results.all_samples) {0: [array([1.26208025]), array([1.53910032]), array([-1.29648336]), array([0.75743215]), array([-0.17850101]), array([-1.44751996])]}
For more details, see the code documentation.
-
Adds the function
VibronicTransition
to theapps.qchem.vibronic
module. This function generates a custom Strawberry Fields operation for applying the Doktorov operator on a given state. (#451)>>> from strawberryfields.apps.qchem.vibronic import VibronicTransition >>> modes = 2 >>> p = sf.Program(modes) >>> with p.context as q: ... VibronicTransition(U1, r, U2, alpha) | q
-
Adds the
TimeEvolution
function to theapps.qchem.dynamics
module. This function generates a custom Strawberry Fields operation for applying a time evolution operator on a given state. (#455)>>> modes = 2 >>> p = sf.Program(modes) >>> with p.context as q: ... sf.ops.Fock(1) | q[0] ... sf.ops.Interferometer(Ul.T) | q ... TimeEvolution(w, t) | q ... sf.ops.Interferometer(Ul) | q
where
w
is the normal mode frequencies, andt
the time in femtoseconds. -
Molecular data and pre-generated samples for water and pyrrole have been added to the data module of the Applications layer of Strawberry Fields. For more details, please see the data module documentation (#463)
-
Adds the function
read_gamess
to the qchem module to extract the atomic coordinates, atomic masses, vibrational frequencies, and normal modes of a molecule from the output file of a vibrational frequency calculation performed with the GAMESS quantum chemistry package. (#460)>>> r, m, w, l = read_gamess('../BH_data.out') >>> r # atomic coordinates array([[0.0000000, 0.0000000, 0.0000000], [1.2536039, 0.0000000, 0.0000000]]) >>> m # atomic masses array([11.00931, 1.00782]) >>> w # vibrational frequencies array([19.74, 19.73, 0.00, 0.00, 0.00, 2320.32]) >>> l # normal modes array([[-0.0000000e+00, -7.5322000e-04, -8.7276210e-02, 0.0000000e+00, 8.2280900e-03, 9.5339055e-01], [-0.0000000e+00, -8.7276210e-02, 7.5322000e-04, 0.0000000e+00, 9.5339055e-01, -8.2280900e-03], [ 2.8846925e-01, -2.0000000e-08, 2.0000000e-08, 2.8846925e-01, -2.0000000e-08, 2.0000000e-08], [ 2.0000000e-08, 2.8846925e-01, -2.0000000e-08, 2.0000000e-08, 2.8846925e-01, -2.0000000e-08], [-2.0000000e-08, 2.0000000e-08, 2.8846925e-01, -2.0000000e-08, 2.0000000e-08, 2.8846925e-01], [-8.7279460e-02, 0.0000000e+00, 0.0000000e+00, 9.5342606e-01, -0.0000000e+00, -0.0000000e+00]])
Improvements
- When jobs submitted to the Xanadu Quantum Cloud are canceled, they will now display a
cancel_pending
JobStatus until the cancellation is confirmed. (#456)
Bug fixes
-
Fixed a bug where the function
reduced_dm
inbackends/tfbackend/states.py
gives the wrong output when passing it several modes. (#471) -
Fixed a bug in the function
reduced_density_matrix
inbackends/tfbackend/ops.py
which caused the wrong subsystems to be traced out. (#467) (#470) -
Fixed a bug where decompositions to Mach-Zehnder interferometers would return incorrect results on NumPy 1.19. (#473)
-
The Walrus version 0.14 introduced modified function names. Affected functions have been updated in Strawberry Fields to avoid deprecation warnings. (#472)
Documentation
-
Adds further testing and coverage descriptions to the developer documentation. This includes details regarding the Strawberry Fields test structure and test decorators. (#461)
-
Updates the minimum required version of TensorFlow in the development guide. (#468)
Contributors
This release contains contributions from (in alphabetical order):
Juan Miguel Arrazola, Tom Bromley, Theodor Isacsson, Josh Izaac, Soran Jahangiri, Nathan Killoran, Fabian Laudenbach, Nicolás Quesada, Antal Száva, Ilan Tzitrin.