Skip to content
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

Notebooks enabled for Google colab ("No local install" needed) #198

Merged
merged 39 commits into from
Aug 19, 2022

Conversation

alexfleury-sb
Copy link
Contributor

Here are the highlights. Do you have feedbacks about doing the same thing with other notebooks and the pip command (use of pip install tangelo-gc, etc.)?

  • Added a cell at the beginning of the adapt, classical_shadows, dmet, oniom, vqe and vqe_custom notebooks:
try
    import tangelo
except ModuleNotFoundError:
    !pip install git+https://github.com/goodchemistryco/Tangelo.git@develop --quiet
  • Removed an unused "import google" in overview notebook.
  • The adapt notebook was not up-to-date with the last changes. It can be ran now.

Here are the GColab links (the links are coming from my fork for now):

Notebook GColab link
VQE https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe.ipynb
Custom VQE https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/vqe_custom_ansatz_hamiltonian.ipynb
ADAPT-VQE https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/adapt.ipynb
DMET https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/dmet.ipynb
ONIOM https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/oniom.ipynb
Classical Shadows https://colab.research.google.com/github/AlexandreF-1qbit/Tangelo/blob/gcolab/examples/classical_shadows.ipynb

@ValentinS4t1qbit
Copy link
Contributor

A few comments:

  • For each notebook, make sure the cell is preceded by a sentence that makes things look natural. For example, in the VQE and DMET notebook, there's a sentence that says "In order to run this notebook, you need...": the cell would be perfect afterwards. If such a sentence does not exist, you can add one.

  • We need to add stuff to README.rst in the tutorials section (or refer to TUTORIALS.rst) telling how users can turn any notebook from our repo into google collab ones, and points to useful basic info about google collab (you're also educating us).

  • Don't forget about the linq notebooks

@alexfleury-sb
Copy link
Contributor Author

alexfleury-sb commented Aug 17, 2022

2 points that could need a discussion:

  • I added a sentence (copy/pasted) from the VQE notebook before every installation cell.
    This notebook assumes that you already have installed Tangelo in your Python environment, or have updated your Python path so that the imports can be resolved. If not, executing the cell below installs the minimal requirements for this notebook.
  • The linq notebooks have an "installation" cell now. I also install the qiskit, braket and qulacs packages at the same time. Therefore, all cell with projectq and qdk will fail. Is it bad considering there is already a warning Here are a few examples. Some cells may fail depending on what packages you have installed.? The other option is to convert the failing cells to markdown.

@ValentinS4t1qbit ValentinS4t1qbit changed the title Google colab compatibility Notebooks enabled for Google colab ("No local install" needed) Aug 19, 2022
Copy link
Contributor

@ValentinS4t1qbit ValentinS4t1qbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Alexandre, I have learnt a lot from your exploration and notes

@ValentinS4t1qbit ValentinS4t1qbit merged commit 5e58dcd into goodchemistryco:develop Aug 19, 2022
ValentinS4t1qbit added a commit that referenced this pull request Aug 25, 2022
* Formula for estimating n_measurements for exp value to given accuracy updated with simpler form. (#192)
* Fix operator_expectation bug qith qubit operator / hamiltonian. (#191)
* iqcc ilc solver fork (#179)
* Make circuit iterable (#194)
* copy method for circuits + get_resources adjusted for some variations of VQE + invertible swap gate fix (#193)
* get_resources methods adjusted (VQE, SA-VQE)
* Release guide for project maintainers + version string (#195)
* Notebook: Important aspects of QChem modelling for QComputing (#199)
* Notebooks enabled for Google colab ("No local install") (#198)
* Docker fix (#200)
* Excited states notebook (#197)
* Translation function for qiskit qubit operators (paulisumop) (#196)

Co-authored-by: Valentin Senicourt <valentin.senicourt@1qbit.com>
Co-authored-by: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com>
Co-authored-by: JamesB-1qbit <84878946+JamesB-1qbit@users.noreply.github.com>
Co-authored-by: MPCoons <84400409+MPCoons@users.noreply.github.com>
@alexfleury-sb alexfleury-sb deleted the gcolab branch September 6, 2022 13:57
ValentinS4t1qbit added a commit that referenced this pull request Nov 9, 2022
* Formula for estimating n_measurements for exp value to given accuracy updated with simpler form. (#192)
* Fix operator_expectation bug qith qubit operator / hamiltonian. (#191)
* iqcc ilc solver fork (#179)
* Make circuit iterable (#194)
* copy method for circuits + get_resources adjusted for some variations of VQE + invertible swap gate fix (#193)
* Release guide for project maintainers + version string (#195)
* Notebook: Important aspects of QChem modelling for QComputing (#199)
* Notebooks enabled for Google colab ("No local install" needed) (#198)
* Docker fix (#200)
* Excited states (#197)
* Translation function for qubit operators (#196)
* c2v axis definition changed (#205)
* Bidirectional conversion for Qiskit quantum circuits (#203)
* QEMISTClientConnection class (#207)
* Add n_qubits option to MultiformOperator compress function (#209)
* Quantum Signal Processing time-evolution (#204)
* added even trotter order > 2 (#210)
* Fixed number of qubits with scBK in ADAPT. (#214)
* Export coverage output file in github actions (#158)
* JKMN vector prep should return np array of int. (#215)
* Support for additional IonQ gates (#212)
* Remove unused n_min_orbitals attribute. (#218)
* Change JKMN Majorana definition so mapped Hamiltonian is real (#219)
* Relaxing condition fot iQCC-ILC test. (#221)
* Histogram class (#217)
* Compute energy from RDMs with FermionOperator (#220)
* IonQConnection: control update prints / verbosity. (#225)
* Refactor simulator (#213)
* added __repr__ method to Gate (#229)
* New bidirectional circuit translation functions and interface (#223)
* Add circuit.depth() in get_resources methods (#235)
* Variance and standard error of an expectation value (#238)
* VQESolver cleanup (#230)
* TETRIS-ADAPT-VQE (#241)
* TETRISADAPTSolver implementation + #224 fix
* Trotter order and active electrons for (i)QCC (#234)
* Symmetry post-selection (#232)
* Qiskit runtime integration (IBM quantum only) (#222)
* Add multi-control support for trotterization (#244)
* Compatibility with new QCloud outputs. (#246)
* Deprecate Simulator, introduce get_backend as replacement (#245)
* compute_rdms function (#228)
* Expanded FermionOperator attributes, defined logical and mathematical operations on it (add, mul, eq, etc)
* Bumping Tangelo version number in _version.py
* Update CHANGELOG.md

Co-authored-by: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com>
Co-authored-by: James Brown <james.brown@1qbit.com>
Co-authored-by: JamesB-1qbit <84878946+JamesB-1qbit@users.noreply.github.com>
Co-authored-by: MPCoons <84400409+MPCoons@users.noreply.github.com>
Co-authored-by: elloyd-1qbit <58313607+elloyd-1qbit@users.noreply.github.com>
Co-authored-by: KrzysztofB-1qbit <86750444+KrzysztofB-1qbit@users.noreply.github.com>
Co-authored-by: Rudi Plesch <rudi.plesch@1qbit.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Co-authored-by: Valentin Senicourt <valentin.senicourt@1qbit.com>
Co-authored-by: Joshua Goings <3915169+jjgoings@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants