-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix combinatorial mapping when spin!=0 #330
Merged
ValentinS4t1qbit
merged 1 commit into
sandbox-quantum:develop
from
alexfleury-sb:fix_combinatorial_open_shell
Jul 17, 2023
Merged
Fix combinatorial mapping when spin!=0 #330
ValentinS4t1qbit
merged 1 commit into
sandbox-quantum:develop
from
alexfleury-sb:fix_combinatorial_open_shell
Jul 17, 2023
Conversation
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
alexfleury-sb
requested review from
ValentinS4t1qbit and
JamesB-1qbit
as code owners
July 17, 2023 19:31
JamesB-1qbit
approved these changes
Jul 17, 2023
ValentinS4t1qbit
approved these changes
Jul 17, 2023
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.
Thank you for the fix ! Does this warrant a new test to be added ? If not, we can merge.
ValentinS4t1qbit
added a commit
that referenced
this pull request
Sep 20, 2023
Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> * Supporting symbols as parameters and add nsimplify to results (#300) * Symbolic expression simplified. * Simplification of exp. value and fixed a bug in translate op. * Add ability to get inverse with Symbol parameters. * Switch nsimplify to evalf. * Trim trivial qubits from circuit and Hamiltonian (#302) Remove qubits that are in a deterministic state in quantum circuits, and simplify qubit Hamiltonian accordingly, in order to reduce resource requirements while computing expectation values. --------- Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> * Push contributors towards develop and not to main for PRs (#303) * Update to CONTRIB (main -> develop) and added workflow to help avoid PR to main that are not from develop * Set the DMET virtual orbital truncation threshold at the user level (#304) * Add option to turn off virt. orb. truncation. * Changed the threshold instead of a flag. Occ. set to their abs values. * Trim bug (#305) * minor bug fixes + test * Added typing for option dictionaries in quantum agorithms (#307) * added typing for option dictionaries, which improves user experience (autocomplete, auto-loading of docstrings for different GUIs) and handle options better overall * IntegralSolver class: base + support for Psi4 (#297) * Tests for pyscf, test for psi4, tests for custom IntegralSolver * temporary: install NO_PYSCF available to users * new: MP2Solver This PR will be followed by 1-2 other PRs to decouple pyscf from almost all algorithms and streamline the use of classical chem backends (support for all classical solvers, turning pyscf as an optional dependency for Tangelo, fixing docs and README etc as a result) * Change multi-controlled CNOT to multi-controlled CX (#308) * change multi-controlled CNOT to multi-controlled CX --------- Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> * Braket connection (#312) Support for Braket connection, including batch submission of jobs. Tests, docs, refresh of env_var.sh A PR for the QPU notebook will follow --------- Co-authored-by: Valentin Senicourt <valentin.senicourt@1qbit.com> Co-authored-by: ValentinS4t1qbit <valentin@goodchemistry.gmail> * Support for UMP2 initial parameters (#310) * Support for UMP2 initial parameters. * Checkfile for IntegralSolverPySCF (#311) * chkfile for IntegralSolverPySCF. * QubitOperator import from Tangelo, for better encapsulation (#299) * Use Tangelo's `QubitOperator` instead of OpenFermion when possible. * Constructor method `from_openfermion` and export method `to_openfermion` available in `QubitOperator` class. Remaining usage of Openfermion is tied to qubit mappings mostly, and code relying on other Openfermion features. --------- Co-authored-by: Valentin Senicourt <valentin.senicourt@1qbit.com> Co-authored-by: ValentinS4t1qbit <valentin@goodchemistry.gmail> * FCISolverPsi4 (#309) * moved chem tests to molecular_computation tests * Changed FCISolver to class with solver attribute --------- Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> * Removed deprecated Linq functions (#316) * Removed deprecated versions of trasnlation functions and Simulator. --------- Co-authored-by: Valentin Senicourt <valentin.senicourt@1qbit.com> Co-authored-by: ValentinS4t1qbit <valentin@goodchemistry.gmail> * CCSD solver psi4 (#313) * add ccsd_solver test to psi4 testing * get_rdm currently not supported, suggestions added in comments * ADAPT: add spin to available options (#317) * add spin to available options and docstring * MP2 psi4 (#315) * Support for MP2 with psi4 backend. * get_rdm and get_mp2_parameters currently unsupported, suggestions left in docstrings. * skip performance tests (Linq) in pytest (#319) Perrformance tests take time and should not be run systematically * Typos in docs (#321) * Added spaces in messages. * Typos and code format. * Add period. * DMET Effective Core Potential fix(related to #306) (#318) * potential fix for #306, test added * Change installation (#320) * remove no_pyscf, attempt windows test * updated psi4 test --------- Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> * DMET-ecp test fix: change optimizer to minimize square (#323) * improved Error message for MP2 initialization in UCCSD (pySCf currently required) (#322) * improved Error message for MP2 initialization if pyscf is not found * Qiskit-related: deprecation update to SparsePauliOp and bug workaround (#325) * Stim clifford simulator integration (#314) * direct tableau * noise and circuit sampler * decomposition into clifford gates * clifford decomp tests, and SDAG in cirq * is_clifford in gate class * expand clifford decomp to integer values * small comments, add pip install stim to workflow Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> * Bump develop to v0.4.0.RC (#327) * Update _version.py * Fixed requirements (#324) * Remove pre-install reqs (wheel) * Remove openfermionpyscf as not needed anymore * Us extra_requires for pyscf optional dependencies. * Removed unused imports * Use long description for long description * Fix combinatorial mapping when spin!=0. (#330) * QPESolver implementation (#332) * fix qiskit-aer installation * Initial QPE framework: vanilla QPE with built-in or user-defined unitary * Fixes to MIFNOHelper after QEMIST Cloud 0.6.0 release (#331) * Fixes to keep up with the update of QEMIST Cloud * Adding more python versions to tests (#333) * adding more python versions to tests, per-version artifacts files, ensuring all of them fully run regarding of failure --------- Co-authored-by: ValentinS4t1qbit <valentin@goodchemistry.gmail> * Bug Fix: n_shots parameter was ignored in get_expectation_value (#337) * add missed condition in get_expectation_value * added test relying on std_dev * convert all gate names to upper case and check that it is a string (#340) * Fixes for new version of qiskit runtime. Tangelo now supports sampler with several circuits (#341) Co-authored-by: ValentinS4t1qbit <valentin@goodchemistry.gmail> * Function that returns the qubits used for Truncated Taylor Series (#339) * added function that returns the qubits used for truncated taylor series * removed spurious arg in docstring * Support for following VQE minimization in VQESolver (#342) * HiddenPrints with verbose option. Option to save energies at each opt steps. * Variable for number of steps. * Align things. * Readme update: more straight to the point. (#343) --------- Co-authored-by: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Co-authored-by: James Brown <84878946+JamesB-1qbit@users.noreply.github.com> Co-authored-by: KrzysztofB-1qbit <86750444+KrzysztofB-1qbit@users.noreply.github.com> Co-authored-by: Valentin Senicourt <valentin.senicourt@1qbit.com> Co-authored-by: James Brown <james.brown@1qbit.com> Co-authored-by: ValentinS4t1qbit <valentin@goodchemistry.gmail> Co-authored-by: elloyd-1qbit <58313607+elloyd-1qbit@users.noreply.github.com> Co-authored-by: Charles Coulombe <ccoulombe@users.noreply.github.com>
ValentinS4t1qbit
added a commit
that referenced
this pull request
Oct 18, 2023
* Fixed requirements (#324) * Remove pre-install reqs (wheel) * Remove openfermionpyscf as not needed anymore * Us extra_requires for pyscf optional dependencies. * Fix combinatorial mapping when spin!=0. (#330) * QPESolver implementation (#332) * fix qiskit-aer installation * Initial QPE framework: vanilla QPE with built-in or user-defined unitary * Fixes to MIFNOHelper after QEMIST Cloud 0.6.0 release (#331) * Adding more python versions to tests (#333) * Bug Fix: n_shots parameter was ignored in get_expectation_value (#337) * add missed condition in get_expectation_value, added test relying on std_dev * convert all gate names to upper case and check that it is a string (#340) * Fixes for new version of qiskit runtime. Tangelo now supports sampler with several circuits (#341) * Function that returns the qubits used for Truncated Taylor Series (#339) * added function that returns the qubits used for truncated taylor series * Support for following VQE minimization in VQESolver (#342) * HiddenPrints with verbose option. Option to save energies at each opt steps. * Readme update: more straight to the point. (#343) * Classical solver uses mo_coeff from SecondQuantizedMolecule (#338) * small fix for assigning mo_coeff to classical solver * CCSDSolver and FCISolver use SecondQuantizedMolecule mo_coeff for both psi4 and pyscf * moved imports to top of file * Simplify method for circuits (#345) * convenience functions to merge compatible rotations and umbrella simplify function to combine simplification primitives and run passes on a circuit recursively * QM/MM support with electrostatic embedding (#336) * QMMM with psi4 and pyscf * corner case to handle psi4 v1.6 * support for rdkit * improved support for multiple pdb files * Added MMChargesSolver class, IntegralSolver can be chosen * Small fixes for ILC (#346) * added functions that implement exact expansion/ parameters for ILC iteration * small fixes so that the circuit generated from the ilc eigenvalue problem has the same energy * QM/MM: charges solvers made consistent with users choices. (#347) * Removed QubitHamiltonian use in QITESolver. * Performance upgrade to combinatorial mapping (#348) * Update to combinatorial, using recursive version instead of initial naive one with qubit operators. Further work has started to improve performance and reduce memory consumption Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Co-authored-by: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Co-authored-by: James Brown <84878946+JamesB-1qbit@users.noreply.github.com> Co-authored-by: Charles Coulombe <ccoulombe@users.noreply.github.com>
cburdine
pushed a commit
to cburdine/Tangelo
that referenced
this pull request
May 31, 2024
* Fixed requirements (sandbox-quantum#324) * Remove pre-install reqs (wheel) * Remove openfermionpyscf as not needed anymore * Us extra_requires for pyscf optional dependencies. * Fix combinatorial mapping when spin!=0. (sandbox-quantum#330) * QPESolver implementation (sandbox-quantum#332) * fix qiskit-aer installation * Initial QPE framework: vanilla QPE with built-in or user-defined unitary * Fixes to MIFNOHelper after QEMIST Cloud 0.6.0 release (sandbox-quantum#331) * Adding more python versions to tests (sandbox-quantum#333) * Bug Fix: n_shots parameter was ignored in get_expectation_value (sandbox-quantum#337) * add missed condition in get_expectation_value, added test relying on std_dev * convert all gate names to upper case and check that it is a string (sandbox-quantum#340) * Fixes for new version of qiskit runtime. Tangelo now supports sampler with several circuits (sandbox-quantum#341) * Function that returns the qubits used for Truncated Taylor Series (sandbox-quantum#339) * added function that returns the qubits used for truncated taylor series * Support for following VQE minimization in VQESolver (sandbox-quantum#342) * HiddenPrints with verbose option. Option to save energies at each opt steps. * Readme update: more straight to the point. (sandbox-quantum#343) * Classical solver uses mo_coeff from SecondQuantizedMolecule (sandbox-quantum#338) * small fix for assigning mo_coeff to classical solver * CCSDSolver and FCISolver use SecondQuantizedMolecule mo_coeff for both psi4 and pyscf * moved imports to top of file * Simplify method for circuits (sandbox-quantum#345) * convenience functions to merge compatible rotations and umbrella simplify function to combine simplification primitives and run passes on a circuit recursively * QM/MM support with electrostatic embedding (sandbox-quantum#336) * QMMM with psi4 and pyscf * corner case to handle psi4 v1.6 * support for rdkit * improved support for multiple pdb files * Added MMChargesSolver class, IntegralSolver can be chosen * Small fixes for ILC (sandbox-quantum#346) * added functions that implement exact expansion/ parameters for ILC iteration * small fixes so that the circuit generated from the ilc eigenvalue problem has the same energy * QM/MM: charges solvers made consistent with users choices. (sandbox-quantum#347) * Removed QubitHamiltonian use in QITESolver. * Performance upgrade to combinatorial mapping (sandbox-quantum#348) * Update to combinatorial, using recursive version instead of initial naive one with qubit operators. Further work has started to improve performance and reduce memory consumption Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Co-authored-by: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com> Co-authored-by: James Brown <84878946+JamesB-1qbit@users.noreply.github.com> Co-authored-by: Charles Coulombe <ccoulombe@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix for the combinatorial mapping when
spin!=0
, i.e. when there are a different number of alpha and beta electrons. For convenience (if we want to work with a matrix), it ensures that the combinatorial integers are between 0 and 2^n_qubit - 1. As of now, whenspin!=0
,n_choose_alpha != n_choose_beta
and the chosen integers suffer discontinuities.This has no effect on the number of qubit and the resulting qubit operators (as they are equivalent by remapping qubit indices). It also has no effect when
n_choose_alpha == n_choose_beta
.