Recent Releases of lightworks
lightworks - Release 2.2.6
This update improves the capability of the qiskit converter, allowing arbitrary single qubit rotation gates (UGate in qiskit) and barriers to be included in circuits and converted to the Lightworks equivalent.
It also adds better warnings when a batch task cannot be built due to user error, and contains a number of changes to the backend designed to make it easier to develop and integrate extensions to Lightworks.
What's Changed
- Remove basis generation from runners by @HarryBromley in https://github.com/Aegiq/lightworks/pull/169
- Circuit equivalence by @HarryBromley in https://github.com/Aegiq/lightworks/pull/170
- Move backend map by @HarryBromley in https://github.com/Aegiq/lightworks/pull/171
- Better batch warnings by @HarryBromley in https://github.com/Aegiq/lightworks/pull/172
- Single qubit unitary support by @HarryBromley in https://github.com/Aegiq/lightworks/pull/173
- Qiskit converter barrier support by @HarryBromley in https://github.com/Aegiq/lightworks/pull/174
- Release 2.2.6 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/175
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.2.5...v2.2.6
- Python
Published by HarryBromley 6 months ago
lightworks - Release 2.2.5
This release adds a new way to run tasks on a backend and brings optimisations to the sampling methods.
Backend direct call
A backend can now be called directly, treating it as a function, meaning the run method can by bypassed (though this method still works). This is mainly added as a convenience feature to simplify code. As a result, the following are now both valid ways to run a task.
backend.run(task)
backend(task)
Sampler optimisation
The routines for sampling from a calculated distribution have been optimised, these are utilised within the Sampler task. The speedup observed will be very dependent on the exact requirement of the task (e.g. a small circuit with a lot of samples may benefit more than a large circuit with very samples), but in some cases 5-10x speedups have been observed.
What's Changed
- Copyright header update by @HarryBromley in https://github.com/Aegiq/lightworks/pull/165
- Direct backend call by @HarryBromley in https://github.com/Aegiq/lightworks/pull/166
- Sampling optimisation by @HarryBromley in https://github.com/Aegiq/lightworks/pull/167
- Release 2.2.5 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/168
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.2.4...v2.2.5
- Python
Published by HarryBromley 7 months ago
lightworks - Release 2.2.4
This is a minor release, adding the ability to show barriers with the circuit visualization tool using the display_barriers argument. There is also a rework of the display backend and improvements to various aspects of the documentation.
What's Changed
- Process fidelity test fix by @HarryBromley in https://github.com/Aegiq/lightworks/pull/160
- Sphinx workflow fail on warning by @HarryBromley in https://github.com/Aegiq/lightworks/pull/161
- Post selection & improved referencing in docs by @HarryBromley in https://github.com/Aegiq/lightworks/pull/159
- Docs typo & missing reference by @HarryBromley in https://github.com/Aegiq/lightworks/pull/162
- Display barriers & backend update by @HarryBromley in https://github.com/Aegiq/lightworks/pull/163
- Release 2.2.4 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/164
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.2.3...v2.2.4
- Python
Published by HarryBromley 7 months ago
lightworks - Release 2.2.3
This updates fixes a bug with how state fidelity is calculated and allows for post-selection to be applied to results. It also includes some minor improvements to the code base to improve the reliability of Lightworks.
State fidelity
The state_fidelity calculation function in the tomography was missing a square, meaning the calculated value was often higher than it should be. This has now been corrected to ensure valid values are being produced by this function.
Post-selection to results
A new apply_post_selection method has been added to the SamplingResult & SimulationResult objects. This allows for a set of post-selection criteria to be applied to the results after calculation, if this is required.
What's Changed
- State fidelity correction by @HarryBromley in https://github.com/Aegiq/lightworks/pull/155
- Add all to modules by @HarryBromley in https://github.com/Aegiq/lightworks/pull/156
- Apply post-selection to results by @HarryBromley in https://github.com/Aegiq/lightworks/pull/157
- Release 2.2.3 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/158
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.2.2...v2.2.3
- Python
Published by HarryBromley 8 months ago
lightworks - Release 2.2.2
This release implements a save_figure method to PhotonicCircuit, allowing the display output to be saved to a file rather than being displayed in the current notebook. This supports writing as both an svg and png, however png may require Cairo to be installed as an additional dependency - this will be raised as an error to users.
It also adds the barrier as a component within the compiled circuit spec, which is intended to allow this component to be used to force separation of components during a compilation procedure. A number of other small improvements to the documentation and codebase have also been made.
Breaking Changes
lightworks.Displayhas now been switched tolightworks.displayto reflect this is a function rather than a class. This change will not affect any users which were previously callingPhotonicCircuit.displayfor visualization.
What's Changed
- Pytest OS checks by @HarryBromley in https://github.com/Aegiq/lightworks/pull/150
- Circuit figure saving & display switch by @HarryBromley in https://github.com/Aegiq/lightworks/pull/149
- Action improvements by @HarryBromley in https://github.com/Aegiq/lightworks/pull/151
- Workflow fix by @HarryBromley in https://github.com/Aegiq/lightworks/pull/152
- Documentation convert fixes by @HarryBromley in https://github.com/Aegiq/lightworks/pull/148
- Include barrier in circuit spec by @HarryBromley in https://github.com/Aegiq/lightworks/pull/153
- Release 2.2.2 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/154
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.2.1...v2.2.2
- Python
Published by HarryBromley 9 months ago
lightworks - Release 2.2.1
This release adds better tools for performing analysis of process tomography, enabling the state density matrices & fidelities to be extracted for each input used within the tomography. This is achieved with the process_state_fidelities & process_density_matrices methods, expected density matrices can also be calculated with get_expected_density_matrices for a given target process.
It also adds better validation of provided inputs & heralds in the tasks, aiming to prevent a scenario where the number of input photons was not large enough to reach a target heralding condition.
What's Changed
- Validate number of output heralds against input by @HarryBromley in https://github.com/Aegiq/lightworks/pull/145
- Density matrices from process tomography by @HarryBromley in https://github.com/Aegiq/lightworks/pull/146
- Release 2.2.1 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/147
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.2...v2.2.1
- Python
Published by HarryBromley 9 months ago
lightworks - Release 2.2
This release reworks how tomography algorithms are run within Lightworks and also adds support for different numbers of heralded photons at the input/output of a circuit, while also changing how heralds are programmed. It also introduces a few bug fixes and brings some general improvements to the code base for improved reliability.
Tomography Rework
The method for calling Tomography algorithms in Lightworks has changed. Whereas previously, users would provide an experiment function which could be called by the tomography routine, now a list of experiments is provided to the user with get_experiments. This set of experiments is then run by the user to generate results and returned to the process method for generation of the tomography results. See the updated documentation for more examples of how this is used.
This change was primarily made after feedback on the current method. It was found that, particularly when running jobs on hardware, the convenience of having the tomography object directly calculate and retrieve results did not outweigh the additional flexibility of splitting these into two components.
Varied Heralding Numbers
Lightworks now supports a different number of heralded photons at the input & output of a circuit. This brings additional flexibility for how heralds are used to realised operations in photonic systems. As part of this change, the order of which heralds are specified in PhotonicCircuit.herald was updated to be more consistent with other methods across Lightworks. Previously where herald(0, 2) was used, this would now be herald(2,0) & herald(0, 1, 2) would now be herald((1, 2), 0). When using different modes or photons, this is now specified as a tuple rather than as individual components.
Other changes
- An issue has been fixed which could allow for accidental modification of the
SamplingResult&SimulationResultobjects. If for some reason these need to be modified then a copy should be made withdict(results). - Heralded mode & photon data in
PhotonicCircuitis now stored as a dataclass to improve the reliability of the code. Elsewhere inPhotonicCircuitcode has been reworked and simplified. - A bug was fixed in which a circuit could accidentally be modified when it was added to another circuit, creating unexpected configurations.
- The citation file has been introduced and code is now additionally stored on Zenodo.
Breaking Changes
- Tomography code will need to be updated to call
get_experimentsand pass results data back toprocess. - The order of which modes and photons are specified when adding heralds has been reversed. Whereas previously this was
(n_photons, in_mode, out_mode)this is now(mode, photon),((in_mode, out_mode), (in_photon, out_photon))or some combination of these.
What's Changed
- Restrict result edit and ruff fix by @HarryBromley in https://github.com/Aegiq/lightworks/pull/133
- Citation file by @HarryBromley in https://github.com/Aegiq/lightworks/pull/134
- Fix citation file name by @HarryBromley in https://github.com/Aegiq/lightworks/pull/135
- Doi link by @HarryBromley in https://github.com/Aegiq/lightworks/pull/136
- Docs github footer icon by @HarryBromley in https://github.com/Aegiq/lightworks/pull/137
- Support varied herald numbers by @HarryBromley in https://github.com/Aegiq/lightworks/pull/138
- Photonic circuit improvements by @HarryBromley in https://github.com/Aegiq/lightworks/pull/139
- Circuit parameter type hints by @HarryBromley in https://github.com/Aegiq/lightworks/pull/140
- Fix tomography experiment order by @HarryBromley in https://github.com/Aegiq/lightworks/pull/141
- Rework of tomography processing by @HarryBromley in https://github.com/Aegiq/lightworks/pull/142
- Workflow permission vulnerability by @HarryBromley in https://github.com/Aegiq/lightworks/pull/143
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.1.3...v2.2
- Python
Published by HarryBromley 9 months ago
lightworks - Release 2.1.3
This release fixes a bug which could cause Analyzer tasks to fail when herald components were used with one or more photons. It also features some minor backend improvements, aiming to improve consistency across the package
What's Changed
- Analyzer herald bug by @HarryBromley in https://github.com/Aegiq/lightworks/pull/130
- Code improvements + dependency fix by @HarryBromley in https://github.com/Aegiq/lightworks/pull/131
- Release 2.1.3 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/132
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.1.2...v2.1.3
- Python
Published by HarryBromley about 1 year ago
lightworks - Release 2.1.2
This is a minor release, primarily intended to improve type hinting of the package, ensuring anyone using Lightworks can get accurate type hint information.
What's Changed
- Result base class by @HarryBromley in https://github.com/Aegiq/lightworks/pull/127
- Package type hints by @HarryBromley in https://github.com/Aegiq/lightworks/pull/128
- Release 2.1.2 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/129
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.1.1...v2.1.2
- Python
Published by HarryBromley about 1 year ago
lightworks - Release 2.1.1
This release add support for the parameterisation of single qubit gates using the Parameter object. This required a rework of how unitary matrices are stored in Lightworks to support delayed computation through sympy. Also in this update, circuit validation was improved to provide more useful error messages in instances of some common user mistakes.
A few backend changes have also been made to improve the general quality of the Lightworks codebase, but these should have no impact on users.
What's Changed
- Qubit parameter support by @HarryBromley in https://github.com/Aegiq/lightworks/pull/122
- ParameterDict & docs update by @HarryBromley in https://github.com/Aegiq/lightworks/pull/123
- Circuit validation by @HarryBromley in https://github.com/Aegiq/lightworks/pull/124
- Utils import restructuring by @HarryBromley in https://github.com/Aegiq/lightworks/pull/125
- Release 2.1.1 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/126
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.1...v2.1.1
- Python
Published by HarryBromley about 1 year ago
lightworks - Release 2.1
This release adds official support for Python 3.13, introduces a generic map method to Result for performing quick remapping of States, and includes new functions for conversion between dual-rail and qubit states.
Result mapping
Introduced the map method to SamplingResult & SimulationResult, which can be used to remap all output states contained within a particular result using a provided mapping function. This mapping function needs to accept a State as an argument and then also return a State, and may be a custom function created by a user or one of the state mappings from lw.convert. map also accepts additional args & kwargs which are passed directly to the mapping function, allowing for the control of options within these functions.
Conversion consolidation
All conversion functions have been moved to a covert class, providing a central way of accessing these. Conversion functions are therefore now accessed with lw.convert.function instead of lw.function.
Qubit <-> dual-rail conversion
Introduced qubit_to_dual_rail and dual_rail_to_qubit functions which can be used to convert states between the two encoding methods.
- With qubit_to_dual_rail it is possible to provide the state as a State or string, for example "010" would be a valid input.
- dual_rail_to_qubit has an allow_invalid option, which can be used to control whether an exception is raised when an invalid encoding is provided. When set to True, any qubits where an invalid dual-rail encoding is provided (e.g. [1, 1] or [0, 0]) will be replaced by "X".
Other changes
A number of additional changes and improvements have also been made to the module. - Improved documentation has been introduced for tasks. - Increased formatting with ruff. - Changes to how compatibility between backends and tasks is controlled. This data is now stored in the backend.
Breaking Changes
- Moved
decimal_to_db_lossanddb_loss_to_decimalfunctions to the convert module. These are therefore now accessed withlw.convert.function. - Removed
apply_threshold_mappingandapply_parity_mappingmethods from theResultobjects. Instead, these can now be applied using thelw.convert.threshold_mappingandlw.convert.parity_mappingwithResult.map.
What's Changed
- Python 3.13 support by @HarryBromley in https://github.com/Aegiq/lightworks/pull/101
- Removed maximum python version by @HarryBromley in https://github.com/Aegiq/lightworks/pull/114
- Backend compatibility setting by @HarryBromley in https://github.com/Aegiq/lightworks/pull/115
- Task documentation by @HarryBromley in https://github.com/Aegiq/lightworks/pull/116
- Qubit to dual rail conversion by @HarryBromley in https://github.com/Aegiq/lightworks/pull/117
- Generic result remapping by @HarryBromley in https://github.com/Aegiq/lightworks/pull/118
- Ruff formatting update by @HarryBromley in https://github.com/Aegiq/lightworks/pull/119
- Conversion consolidation by @HarryBromley in https://github.com/Aegiq/lightworks/pull/120
- Release 2.1 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/121
Full Changelog: https://github.com/Aegiq/lightworks/compare/v2.0...v2.1
- Python
Published by HarryBromley about 1 year ago
lightworks - Release 2.0
The 2.0 update for Lightworks contains a rework to how computing backends are supported in Lightworks, it also introduces tasks as a new way to create & run jobs, switches Circuit to PhotonicCircuit, and makes a number of other changes . This is intended to support the inclusion of more exciting new features in the future. The documentation has been updated to reflect these changes, please see this for updated examples on the utilisation of Lightworks.
Tasks
Tasks have been introduced as a backend-independent way to create jobs which are to be run on a system - current tasks are Sampler, Simulator & Analyzer. These are contained within the core SDK and are based on the simulation objects within the emulator. A new batch task has also been introduced which enables many jobs to be created and executed simultaneously. Behind the scenes, each task creates a dataclass object with all information required about a job, this can then be interpreted by the chosen backend.
Backends
Backends are now more central to the way calculations are performed within Lightworks, with each task being run against a backend using the run method. For example, to run a sampling experiment, the required would now be:
sampler = lw.Sampler(lw.PhotonicCircuit(4), lw.State([1,0,1,0], 10000)
backend = lw.emulator.Backend("permanent")
results = backend.run(sampler)
For running a task locally, all backends are found within the emulator, currently 'permanent' and 'slos' are both included.
Circuit change
Circuit has been renamed to PhotonicCircuit to better clarify the purpose of this object - i.e. for the encoding of linear optic photonic circuits. This will need to be updated in all scripts.
Global settings
A new global settings attribute has been added to Lightworks. This can be accessed using lightworks.settings. To view included settings and their existing values, print(lightworks.settings) can be used. A setting can then be modified using lightworks.settings.target_setting = new_value, if a value isn't recognised then this will raise an error. Currently the included settings are unitaryprecision, which controls how strictly a matrix must be measured to be unitary, and samplerprobability_threshold which can be used to simplify distributions and speed up calculation by removing outputs which occur with very low probability.
Other changes
A number of additional changes and improvements have also been made to the module.
- The QuickSampler has been removed as it wasn't particularly clear when this should be used. The functionality for this will be included natively at a later date.
- Support for the serialization of circuit components has been added, intended to allow for support of submission of a circuit to cloud schedulers. The serialized circuit specification is calculated and included as part of the compiled circuit.
- Documentation has been improved to include all new changes to the module.
- Type hinting has been improved to ensure users can accurately view likely return types by a function.
Breaking Changes
- User interaction with Backends has been reworked. Now, a task must be created using the tasks from the SDK (
Sampler,Simulator,Analyzer) and these are then executed usingbackend.run(task). - All arguments for a task have been moved into class initialization.
- The QuickSampler has been removed.
Circuithas been replaced withPhotonicCircuit.
What's Changed
- Ruff updates by @HarryBromley in https://github.com/Aegiq/lightworks/pull/102
- Global settings by @HarryBromley in https://github.com/Aegiq/lightworks/pull/103
- Backend rework by @HarryBromley in https://github.com/Aegiq/lightworks/pull/104
- PhotonicCircuit switch by @HarryBromley in https://github.com/Aegiq/lightworks/pull/105
- Backend/task code refactor by @HarryBromley in https://github.com/Aegiq/lightworks/pull/106
- Mypy disallow generics by @HarryBromley in https://github.com/Aegiq/lightworks/pull/107
- Batch task by @HarryBromley in https://github.com/Aegiq/lightworks/pull/108
- Ruff rule ignores + scheduled testing by @HarryBromley in https://github.com/Aegiq/lightworks/pull/109
- Circuit serialization by @HarryBromley in https://github.com/Aegiq/lightworks/pull/110
- Release 2.0 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/111
- Str, repr and all attribute for settings by @HarryBromley in https://github.com/Aegiq/lightworks/pull/112
Full Changelog: https://github.com/Aegiq/lightworks/compare/v1.7...v2.0
- Python
Published by HarryBromley about 1 year ago
lightworks - Release 1.7
This release adds algorithms for Process Tomography, improvements to State Tomography and some additional single qubit gates, as well as various other improvements.
For process tomography, algorithms were added for performing full tomography via linear inversion or maximum likelihood estimation, and for the calculation of average gate fidelity. Examples of using the different process tomography algorithms can be found in the documentation.
For state tomography, support for the specification of additional arguments in the experiment function was included with experiment_args. The number of measurements was also optimised by re-using Z measurement data when I measurements are required, reducing the total number of experiments required from 4^n to 3^n.
In the qubit module, the S, T, SX, Phase, RX, RY & RZ gates were all introduced to include a more complete set of gates within Lightworks. Support for these gates was also added to the qiskit_converter function.
In the emulator, the SamplingResult & SimulationResult objects have also been reworked such that they are now sub-classes of dict. This aims to simplify usage of these objects by making them more similar to Python dictionaries which users are likely to be familiar with, without changing the majority of functionality.
Finally, the documentation has been improved, adding ruff formatting to all example notebooks for consistency and updating with all new changes to Lightworks as part of this release.
Breaking Changes
- In
SimulationResult, outputs can no longer be indexed directly for the single input case, and instead theresult[input, output]syntax must be used. This is intended to add more consistent behaviour when retrieving data. - The dictionary property of
SamplingResult&SimulationResulthas been removed, if for some reason these objects do need to be converted to a proper dictionary then this can be achieved withdict(result).
What's Changed
- Support for additional args within StateTomography experiment function by @HarryBromley in https://github.com/Aegiq/lightworks/pull/89
- State tomography measurement optimisation by @HarryBromley in https://github.com/Aegiq/lightworks/pull/90
- Process tomography by @HarryBromley in https://github.com/Aegiq/lightworks/pull/91
- Single qubit rotation gates by @HarryBromley in https://github.com/Aegiq/lightworks/pull/93
- Additional single qubit gates by @HarryBromley in https://github.com/Aegiq/lightworks/pull/94
- MLE process tomography by @HarryBromley in https://github.com/Aegiq/lightworks/pull/95
- Ruff docs expansion by @HarryBromley in https://github.com/Aegiq/lightworks/pull/96
- Average gate fidelity by @HarryBromley in https://github.com/Aegiq/lightworks/pull/98
- Docs example improvement by @HarryBromley in https://github.com/Aegiq/lightworks/pull/99
- Result improvement by @HarryBromley in https://github.com/Aegiq/lightworks/pull/100
- Release 1.7 by @HarryBromley in https://github.com/Aegiq/lightworks/pull/97
Full Changelog: https://github.com/Aegiq/lightworks/compare/v1.6...v1.7
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.6
This release adds the tomography module, enabling state tomography to be performed on circuits. In a future release process tomography will also be included. There is also a new section of the documentation for the tomography and interferometers modules, which contain tutorials for each of these.
The unit of loss within Lightworks has been updated to a decimal value instead of a dB loss. It is hoped that this will be more intuitive for new users and those unfamiliar with photonics. This will alter the results of any existing code which uses loss elements, so this will need to be updated. The transmission conversion functions have also been updated so that they are now in terms of loss.
In the qubit module, qiskit_converter has been moved to the main import path of qubit, so should no longer be imported from qubit.converters. A single qubit identity gate I has also been introduced.
Behind the scenes, there was a number of updates to improve performance and reliability of Lightworks, including a rework of the circuit compiler, display functionality and some consolidation of functions.
Breaking Changes
- The units of loss have been modified from dB to a decimal value. This will need to be updated in all existing code which utilises loss components, replacing any dB values with
db_loss_to_decimal(dB value). transmission_to_db_losshas been replaced withdecimal_to_db_lossanddb_loss_to_transmissionhas been replaced withdb_loss_to_decimal.qiskit_converterimport has been moved from qubit.converter to qubit, so it can now be imported asfrom lightworks.qubit import qiskit_converter.- Removed the deprecated add_component methods of circuit.
Changelog
- Introduced tomography module with
StateTomographyobject for performing the tomography process, and included associated documentation for this. - Improved and optimised circuit compiler and display components.
- Consolidated random seed processing.
- Added new tutorials and documentation for qubit and interferometers module.
- Fixed a bug within the circuit copy method, which caused issues when copying heralded circuits.
PR: #70
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.5.2
Fixes a bug introduced to the qiskit_converter in 1.5.1 in which it would fail for more complex circuits while allow_post_selection was set to True.
PR: #68
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.5.1
In this release, qiskit_converter is improved to allow for support of post-selected gates when a circuit configuration allows this. Additionally, the PostSelection and PostSelectionFunction objects have been introduced to allow for better management of post-selection criteria within Lightworks.
A new phase_offset option has also been included in the interferometer ErrorModel, allowing for errors in configuring a circuit to be simulated.
Breaking Changes
- The setpostselection method of the Analyzer has been replaced with a post_selection property.
Changelog
- Support for post-selected gates in qiskit_converter, enable utilisation of these more-resource efficient gates when acceptable and compatible with the circuit.
- Implemented PostSelection objects to provide a dedicated way for management and verification of post-selection criteria. It is still possible to set post-selection with a function in the Sampler & QuickSampler.
- Fixed issue where loss elements were always shown in display methods regardless of display_loss option.
- Added phase_offset into interferometer ErrorModel, allowing for variation in phase setting from intended value to be simulated.
PR: #62
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.5
This release adds the qiskit_converter function for converting from a qiskit to Lightworks circuit. It supports all gates included within the Qubit module of Lightworks, although some of these may be in a limited capacity.
Also in this release, the add_ prefix was removed from all circuit component methods, for example if previously add_bs was called then this can be replaced with bs. The old methods still remain but these will raise a deprecation warning when called, this will be removed in the next major release. There was also additional improvements to how data is stored within the circuit class.
Breaking Changes
- Removed add_ prefix from main component functions and included deprecation warning for old methods.
Changelog
- Added
qiskit_converterfunction for moving from a gate-based qiskit circuit to Lightworks and docs for this. - Reworked circuit spec to use data classes, improving consistency and reliability of data storage.
- Improved type hinting and checking across package.
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.4.1
This release expands on the interferometer module, adding a set of random distributions which can be assigned to quantities of the ErrorModel. There is support for creation of custom distribution objects with the Distribution abstract base class.
Also in this release, the usage of the numpy random generation module was adjusted to set seed of a generator per object instead of setting the global random seed. In some cases this may change the results from existing code, as the new rng produces a different set of values.
PR: #54
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.4
In this release, the codebase was reworked to improve formatting, consistency and performance in some cases. A number of qubit gates (Toffoli & Swap) were also added, as well as a feature for mapping circuits to an interferometer.
Changelog
- Added qubit Toffoli & Swap gates.
- Implemented code formatting with ruff and mypy across module.
- Added interferometer module to allow for mapping of circuits to an imperfect photonic circuit layout. This is currently in beta.
- Updated Optimisation class to be compatible with changes to Lightworks.
- Switched default plot show value in SamplingResult and SimulationResult to True.
PR: #43
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.3.3
This release refines the display functionality and documentation, and fixes a couple of issues.
Changelog
- Added a white background to svg circuit figures to ensure these remain visible in a range of display environments.
- Updated documentation figures to include white background so they are all compatible with the dark mode theme.
- Fixed an issue where introducing detection errors would cause the Sampler random seed to no longer function as expected.
- Fixed an issue where results calculated in the QuickSampler were not properly cached.
PR: #41
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.3.2
Fixes a couple of bugs which could occur in the Sampler, one relating to using an imperfect brightness source and the other to an exception raised if the circuit unitary used by the sampler changes size.
The documentation was also improved, introducing a set of tutorials designed to aide in familiarisation with Lightworks.
PR: #36
- Python
Published by HarryBromley over 1 year ago
lightworks - Release 1.3.1
Fixed a bug with getallparams method in circuit and removed some old code from the package.
PR: #33
- Python
Published by HarryBromley almost 2 years ago
lightworks - Release 1.3
With the inclusion of qubit components in Lightworks 1.2, it quickly became clear that trying to identify and manage heralding modes/photons was very difficult when adding more than a single gate. This update therefore adds the integration of heralds into the circuit object, enabling heralds to be abstracted and internally managed in a visual and logical way.
Changelog:
- Integrated heralds within the circuit object, including support for creation of functional heralded sub-circuits which can then be added to a larger circuit.
- Updated display methods to support the inclusion of heralds.
- Included support for heralds within all simulation objects, meaning these modes don't need to be specified by users.
- Minor bug fixes with SimulationResult + library restructuring.
PR: #23
- Python
Published by HarryBromley almost 2 years ago
lightworks - Release 1.2
This release added a set of standard components for implementing photonic qubit gates and expanded on the documentation.
Full change log: - Added single and two qubit gate circuits which can be used to quickly implement required qubit processing. - Improved docs, including sections of backend usage, extra Simulator examples and some information on new qubit components. Also corrected some grammatical issues. - Removed some redundant functions and fidelity calculation as this was not well defined. - Added slos to States and AnnotatedStates to reduce memory usage, also removed pre-calculation of mode number. - Added method in state to perform validation on the values, checking that they are all integers and are not negative. - Adjusted the indexing method used in SimualtionResult, now values are accessed with [input, output] instead of [input:output].
- Python
Published by HarryBromley almost 2 years ago
lightworks - Release 1.0
Initial release of Lightworks
- Python
Published by HarryBromley almost 2 years ago
lightworks - Release 1.1
This release of Lightworks reworks the backend to provide a framework for a future expansion of backend options. A basic SLOS implementation has also been added to the Sampler for initial testing of the backend functionality.
There was also a number of additional updates in this release: - Improved performance of some components. - Expanded on unit tests, including using parametrization in pytest to quickly check a range of values. - Updated docs, detailing the Unitary object and adding a demo notebook for the heralded CNOT.
- Python
Published by HarryBromley almost 2 years ago
lightworks - Release 1.0.1
Minor updates to some of the setup around Lightworks, removing some components in readme and adding project links to setup.py, improving overall display of Lightworks in pypi.
- Python
Published by HarryBromley almost 2 years ago
lightworks - Release 1.0
First release of lightworks, containing the initial SDK and emulation frameworks.
- Python
Published by HarryBromley almost 2 years ago