Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for SamplerV2 primitives (#49)
* Migrating `qiskit_algorithms` (qiskit-community#817) * Update README.md * Generalize the Einstein summation signature * Add reno * Update Copyright * Rename and add test * Update Copyright * Add docstring for `test_get_einsum_signature` * Correct spelling * Disable spellcheck for comments * Add `docstring` in pylint dict * Delete example in docstring * Add Einstein in pylint dict * Add full use case in einsum dict * Spelling and type ignore * Spelling and type ignore * Spelling and type ignore * Spelling and type ignore * Spelling and type ignore * Remove for loop in einsum function and remove Literal arguments (1/2) * Remove for loop in einsum function and remove Literal arguments (1/2) * Remove for loop in einsum function and remove Literal arguments (2/2) * Update RuntimeError msg * Update RuntimeError msg - line too long * Trigger CI * Merge algos, globals.random to fix * Fixed `algorithms_globals` * Import /tests and run CI locally * Fix copyrights and some spellings * Ignore mypy in 8 instances * Merge spell dicts * Black reformatting * Black reformatting * Add reno * Lint sanitize * Pylint * Pylint * Pylint * Pylint * Fix relative imports in tutorials * Fix relative imports in tutorials * Remove algorithms from Jupyter magic methods * Temporarily disable "Run stable tutorials" tests * Change the docstrings with imports from qiskit_algorithms * Styling * Update qiskit_machine_learning/optimizers/gradient_descent.py Co-authored-by: Declan Millar <[email protected]> * Update qiskit_machine_learning/optimizers/optimizer_utils/learning_rate.py Co-authored-by: Declan Millar <[email protected]> * Add more tests for utils * Add more tests for optimizers: adam, bobyqa, gsls and imfil * Fix random seed for volatile optimizers * Fix random seed for volatile optimizers * Add more tests * Pylint dict * Activate scikit-quant-0.8.2 * Remove scikit-quant methods * Remove scikit-quant methods (2) * Edit the release notes and Qiskit version 1+ * Edit the release notes and Qiskit version 1+ * Add Qiskit 1.0 upgrade in reno * Add Qiskit 1.0 upgrade in reno * Add Qiskit 1.0 upgrade in reno * Apply line breaks * Restructure line breaks --------- Co-authored-by: FrancescaSchiav <[email protected]> Co-authored-by: M. Emre Sahin <[email protected]> Co-authored-by: Declan Millar <[email protected]> * Revamp readme pt2 (qiskit-community#822) * Restructure README.md --------- Co-authored-by: Steve Wood <[email protected]> * V2 Primitive Support for SamplerQNN and Gradients * Update base_sampler_gradient.py * Update qiskit_machine_learning/gradients/param_shift/param_shift_sampler_gradient.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/gradients/spsa/spsa_sampler_gradient.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/gradients/spsa/spsa_sampler_gradient.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Edoardo Altamura <[email protected]> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Edoardo Altamura <[email protected]> * Fix lint errors due to Pylint 3.3.0 update in CI (qiskit-community#833) * disable=too-many-positional-arguments * Transfer pylint rc to toml * Transfer pylint rc to toml * Minor fixes * Remove Python 3.8 from CI (qiskit-community#824) (qiskit-community#826) * Remove Python 3.8 in CI (qiskit-community#824) * Correct `tmp` dirs (qiskit-community#818) * Correct unit py version (qiskit-community#818) * Add reno (qiskit-community#818) * Finalze removal of py38 (qiskit-community#818) * Spelling * Remove duplicate tmp folder * Updated the release note * Bump min pyversion in toml * Remove ipython constraints * Update reno * Updated test for test_sampler_qnn * Fix: output_shape * Adding optimisation level to TestSamplerQNN SamplerV2 option * Correcting the PUB prep for SamplerV2 by changing max iterator from n to len(job_param_values). Added a load of print statements to investigate behaviour when self._output_shape = (2, 3) - a tuple as this was failing tests due to a comparison in line 166. This has lead me to think that the way we are calculating QuasiDistribution is wrong as we need to know which real qubits the virtual qubits have been transpiled too to calculate the correct dist for SamplerV2. Following this up with IBM runtime. * Update sampler_qnn.py for correcting tuple output_shape when interpret is provided. * Adding ISA capabilities to gradients * Fix output shape and its default for V2 * Implement SamplerV2 for bayesian inference * Implement SamplerV2 for bayesian inference * Adding ISA capabilities to SamplerQNN and ParamShiftSamplerGradient * Removing unused backend * Removing failed merge conflicts * Removing residual merge conflicts * added SamplerV2 support for ComputeUncompute * Removing multiple tranpilations within same test * Formatting * Linting * Adding measure_all to setUp * removing default pm --------- Co-authored-by: Edoardo Altamura <[email protected]> Co-authored-by: FrancescaSchiav <[email protected]> Co-authored-by: Declan Millar <[email protected]> Co-authored-by: Steve Wood <[email protected]> Co-authored-by: oscar-wallis <[email protected]>
- Loading branch information