GithubHelp home page GithubHelp logo

qutip / qutip-notebooks Goto Github PK

View Code? Open in Web Editor NEW
231.0 231.0 235.0 83.84 MB

A collection of IPython notebooks using QuTiP: examples, tutorials, development test, etc.

License: BSD 3-Clause "New" or "Revised" License

CSS 0.05% Jupyter Notebook 99.94% Python 0.01%

qutip-notebooks's Introduction

QuTiP: Quantum Toolbox in Python

A. Pitchford, C. Granade, A. Grimsmo, N. Shammah, S. Ahmed, N. Lambert, E. Giguère, B. Li, J. Lishman, S. Cross, A. Galicia, P. Menczel, P. Hopf, P. D. Nation, and J. R. Johansson

Build Status Coverage Status Maintainability license PyPi Downloads Conda-Forge Downloads

QuTiP is open-source software for simulating the dynamics of closed and open quantum systems. It uses the excellent Numpy, Scipy, and Cython packages as numerical backends, and graphical output is provided by Matplotlib. QuTiP aims to provide user-friendly and efficient numerical simulations of a wide variety of quantum mechanical problems, including those with Hamiltonians and/or collapse operators with arbitrary time-dependence, commonly found in a wide range of physics applications. QuTiP is freely available for use and/or modification, and it can be used on all Unix-based platforms and on Windows. Being free of any licensing fees, QuTiP is ideal for exploring quantum mechanics in research as well as in the classroom.

Support

Unitary Fund Powered by NumFOCUS

We are proud to be affiliated with Unitary Fund and numFOCUS.

We are grateful for Nori's lab at RIKEN and Blais' lab at the Institut Quantique for providing developer positions to work on QuTiP.

We also thank Google for supporting us by financing GSoC students to work on the QuTiP as well as other supporting organizations that have been supporting QuTiP over the years.

Installation

Pip Package Conda-Forge Package

QuTiP is available on both pip and conda (the latter in the conda-forge channel). You can install QuTiP from pip by doing

pip install qutip

to get the minimal installation. You can instead use the target qutip[full] to install QuTiP with all its optional dependencies. For more details, including instructions on how to build from source, see the detailed installation guide in the documentation.

All back releases are also available for download in the releases section of this repository, where you can also find per-version changelogs. For the most complete set of release notes and changelogs for historic versions, see the changelog section in the documentation.

The pre-release of QuTiP 5.0 is available on PyPI and can be installed using pip:

pip install --pre qutip

This version breaks compatibility with QuTiP 4.7 in many small ways. Please see the changelog for a list of changes, new features and deprecations. This version should be fully working. If you find any bugs, confusing documentation or missing features, please create a GitHub issue.

Documentation

Documentation Status - Latest

The documentation for the latest stable release and the master branch is available for reading on Read The Docs.

The documentation for official releases, in HTML and PDF formats, can be found in the documentation section of the QuTiP website.

The latest development documentation is available in this repository in the doc folder.

A selection of demonstration notebooks is available, which demonstrate some of the many features of QuTiP. These are stored in the qutip/qutip-tutorials repository here on GitHub.

Contribute

You are most welcome to contribute to QuTiP development by forking this repository and sending pull requests, or filing bug reports at the issues page. You can also help out with users' questions, or discuss proposed changes in the QuTiP discussion group. All code contributions are acknowledged in the contributors section in the documentation.

For more information, including technical advice, please see the "contributing to QuTiP development" section of the documentation.

Citing QuTiP

If you use QuTiP in your research, please cite the original QuTiP papers that are available here.

qutip-notebooks's People

Contributors

agaliciamartinez avatar ajgpitch avatar amelie-og avatar anubhavvardhan avatar arnelg avatar bencbartlett avatar boxili avatar cgranade avatar christian512 avatar deeksha-singh030 avatar ericgig avatar fminga avatar hodgestar avatar ivaniscoding avatar jakelishman avatar jonathanulm avatar jrjohansson avatar kafischer avatar leo-am avatar nathanshammah avatar nonhermitian avatar nwlambert avatar pmenczel avatar quantshah avatar sbisw002 avatar stared avatar vutshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qutip-notebooks's Issues

Temporal photon scattering notebook image is missing

The notebook added by #58 has a image missing when viewed on the tutorials page. It's fine when run locally. I have made a few attempts at fixing #59 #60 . Not sure what the refresh is on the Jupyter server. It's not updated after 20 minutes.
I have raised this issue as a reminder to check some time later

Number QuTiP tutorials

Momentarily it is difficult to follow the examples coherently because the order is alphabetical. Would it be possible to add numbers to all the examples?

Link to inexistent notebook

Hi I did not know if to create an issue here or in the documentation side.

At the end of this documentationpage there is a link to this void notebook. I searched for it here but could not find it.

Add notebook on OpenQasm and conversions

It would be nice to have a simple and short notebook to show how to export and import between OpenQasm and qutip.qip.circuit.QubitCircuit, once #1291 is merged. The same could apply to Cirq and qiksit (if applicable) in similar notebooks or the same.

Is the analytical solution right?

In this notebook is the analytical solution as in this image right?
anal-grape
Because on trying (g = pi/ 4* T = 1/8) as in this figure
verify-anal-grape-qutip-example
I am unable to get the U = cnot() (the target unitary)
anal-grape-qutip-target-unitary
I may have commited a mistake somewhere in the calculations. If so, I would be very much obliged if you would point it out to me.

Moving to jupyter?

@cgranade @nonhermitian @jrjohansson Should I avoiding converting existing notebooks to version 4 (jupyter) format? I see that they run fine on the nb server. However, someone I was working with found that they could not open my new notebook because they were still on ipython nb v3. Should we expect users to upgrade to v4?

Keep notebooks updated to latest QuTiP version release

Some notebooks do not run with smoothly with the most recent release.

One could run them every time there is a major release.

The quantum mechanics lectures by @jrjohansson are not updated with latest QuTiP version, and some cells do not run smoothly do to backward compatibility breaks. An issue was recently raised also in the qutip google forum and others were raised in the past.

In order to have the quantum mechanics lectures updated on the qutip website, at qutip.org/tutorials, I see two options

  • one is to open PRs onto Robert's github repository,
  • another one is to fork the repository inside qutip-notebooks and keep them updated from here. In this second case, it may be nice to add a link at the beginning of notebook pointing to the original repository.

Broken links in Lecture 0

There are some broken links in Lecture 0 - Introduction to QuTiP - The Quantum Toolbox in Python (found here). Since I cannot find this on Github to make a pull request, I have created an issue. The new changes are itemized according to subsection.

Introduction - For more information see the project web site at http://qutip.googlecode.com http://qutip.org/, and the documentation at http://qutip.googlecode.com/svn/doc/2.1.0/html/index.html http://qutip.org/documentation.html.

Installation - To install QuTiP, download the latest release from http://code.google.com/p/qutip/downloads/list http://qutip.org/download.html or get the latest code from

For more detailed installation instructions and a list of dependencies that must be installed on the system (basically python+cython+numpy+scipy+matplotlib), see http://qutip.googlecode.com/svn/doc/2.1.0/html/installation.html http://qutip.org/docs/latest/installation.html#building-your-conda-environment.

qutip optimal control expectation value

Hi!

I was wondering if it would be ever possible to perform qutip optimal pulse control by maximizing the expectation of states to some operator A, i.e. C = <psi(T)|O|psi(T)>. I acknowledge that the original qutip optimal control is based on optimizing the fidelity between initial and target states, <psi(T)|psi_target>, so maybe my question can be rephrased into, if I can get psi_target = D * psi(T) and perform the pulse optimization. If there's other ways to achieve this task through Qutip, please let me know! Thank you in advance :)

Parallelism example does not work

Hello, I am trying to reproduce the results in the example notebook
qutip-notebooks/examples/temporal-photon-scattering.ipynb at this location
https://github.com/qutip/qutip-notebooks/blob/master/examples/temporal-photon-scattering.ipynb

I could reproduce all results with no problem, except when I got into the parallelized part. The notebook says BUSY, but there is basically no CPU consumed by the notebook and it stays there forever. Could you suggest some troubleshooting ideas for m to further debug this problem. There is no error message produced. Everything looks quiet, except the BUSY indicator and 0 CPU consumption. I checked the worker_count value, which is 7, and I have 8 CPU's. Query for pool returned
<multiprocessing.pool.Pool at 0x11cd8f10>

This is the version table:

Software Version
QuTiP 4.4.1
Numpy 1.17.1
SciPy 1.3.1
matplotlib 3.1.1
Cython 0.29.13
Number of CPUs 8
BLAS Info OPENBLAS
IPython 7.7.0
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
OS nt [win32]

Thanks!

Yu Chao
Fermi National Accelerator Laboratory

ENH: quantum optics "book" with `jupyter-book` [notebooks part]

The recently introduced jupyter-book feature allows to collate jupyter notebooks and customize the html layout to form a hypertext that can be used as a book.

The current notebooks, and new ones, could be organized as part of such material.

This could be a collective effort with several contributors. See also #1116.

Misprint - Users Guide (Manipulating States and Operators)

Hello!

I've noted misprint in "Qubit (two-level) systems" subsection of "Manipulating States and Operators" section.

I think, that after words "Now at this point one may ask how this state is different than that of a harmonic oscillator in the vacuum state truncated to two energy levels?" you need type code

vac = fock(2, 0) # but in guide in that place this: vac = basis(2, 0)

Sincerely,
Pavel Makarov.

Can't run Quantum Gates examples

Thanks for a great toolbox! I've installed Qutip, can run the demos() OK, but unable to replicate this notebook: http://nbviewer.jupyter.org/github/qutip/qutip-notebooks/blob/master/examples/example-quantum-gates.ipynb. For example, the initial imports are successful but trying to run the command in the first cell, i.e. cphase(pi/2) I get the following error:

NameError Traceback (most recent call last)
in ()
----> 1 cphase(pi/2)

NameError: name 'cphase' is not defined

Am I missing something? I installed qutip via continuum anaconda which is using python 3.5.

Thanks

Runtime error in Bloch Sphere and Wigner function animation tutorial

Getting message "The animation function must return a sequence of Artist objects" when doing the plot_animation.

QuTiP 4.1.0
Numpy 1.11.3
SciPy 0.18.1
matplotlib 2.0.0
Cython 0.25.2
IPython 5.1.0
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 12:22:00) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
OS posix [linux]

QuTiP notebooks online with JupyterHub and BinderHub

Opening this issue to collect ideas toward enhancing server capabilities for the QuTiP users community.

For example, I would find it useful to have some tools for an online interactive classroom using QuTiP. Online notebooks can already be run with My Binder, but setting up more persistent features could be desirable during educational activities such as QuTiP workshops.

There has been quite some development in the Project Jupyter community toward this end, which led to JupyterHub and more recently the overlay of BinderHub.

For the server I see mainly two options:

  • setting an (institutional) server to do this, which would require more time and commitment (security of the network, etc.)
  • using cloud services (such as Google Cloud), which might be easier at first but can quickly become too expensive

There are now a couple of guides to deploy JupyterHub, such as the The Littlest JupyterHub.

For the services, there are possibly two features for the community:

  • set-up of a cloud service for QuTiP-based workshop, which can be used temporarily by instructors and students / participants.

  • set-up of a continuously running cloud service for the QuTiP users community.

Features allowing to flesh out QuTiP live could be also implemented in a live interface similar to live.sympy.org via Google App Engine (this topic would more likely fall within qutip.github.io or qutip/qutip) or the similar sympy gamma.

Move lecture notebooks from https://github.com/jrjohansson/qutip-lectures

There are some very interesting and valuable resources written by @jrjohansson which are linked on the QuTiP page:
https://github.com/jrjohansson/qutip-lectures

I recently used one of them and noticed small bugs and simple things that required updating. Having them in the qutip-notebooks repository would make things much easier and if @jrjohansson and the rest of @qutip/qip-devs do not have any issues, I suggest we move these lecture notebooks here and check that they are updated properly.

@ajgpitch @nathanshammah What do you say?

reason behind using qpt_plot_combined()

What is the reason behind using qpt_plot_combined() instead of matrix_histogram_complex()
in the following cnot, toffoli, iswap, rotation ?
Isn't matrix_histogram_complex() up for the task too?
Pardon me for my silly question. But I could not help if the choice was taken to improve the clarity of visualizing the elements of the matrix (So that the matrix elements are far apart.) .
Or is there a deeper reason?
Maybe @jrjohansson or @nonhermitian could shed some light?

The nonmarkov examples dose not work

The "nonmarkov-transfer-tensor-method" and "nonmarkov-coherent-feedback" example notebooks does not work for qutip 4.5. There has been some data-type erro, the code could not running.

pip Error in My Binder

My Binder currently fails to run, with the following error:

Waiting for build to start...
Picked Git content provider.
Cloning into '/tmp/repo2docker_ixj09qr'...
HEAD is now at 58598bb notebooks for td_Qobj (#55)
Building conda environment for python=3.7Using PythonBuildPack builder
Building conda environment for python=3.7Building conda environment for python=3.7Step 1/44 : FROM buildpack-deps:bionic
 ---> d69026b2a83e
Step 2/44 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 192b16cfde14
Step 3/44 : RUN apt-get -qq update &&     apt-get -qq install --yes --no-install-recommends locales > /dev/null &&     apt-get -qq purge &&     apt-get -qq clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 595f738a8c46
Step 4/44 : RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen &&     locale-gen
 ---> Using cache
 ---> 0ca33f3a05e7
Step 5/44 : ENV LC_ALL en_US.UTF-8
 ---> Using cache
 ---> 8300b0327311
Step 6/44 : ENV LANG en_US.UTF-8
 ---> Using cache
 ---> de921b66e926
Step 7/44 : ENV LANGUAGE en_US.UTF-8
 ---> Using cache
 ---> f5195ac8b0ef
Step 8/44 : ENV SHELL /bin/bash
 ---> Using cache
 ---> 7d5fcc61ce14
Step 9/44 : ARG NB_USER
 ---> Using cache
 ---> e113eb2ce6e7
Step 10/44 : ARG NB_UID
 ---> Using cache
 ---> 59a9521c79dd
Step 11/44 : ENV USER ${NB_USER}
 ---> Using cache
 ---> 2344f491a8ea
Step 12/44 : ENV HOME /home/${NB_USER}
 ---> Using cache
 ---> 8a38b7ca0763
Step 13/44 : RUN adduser --disabled-password     --gecos "Default user"     --uid ${NB_UID}     ${NB_USER}
 ---> Using cache
 ---> 776413092bcf
Step 14/44 : RUN wget --quiet -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key |  apt-key add - &&    DISTRO="bionic" &&     echo "deb https://deb.nodesource.com/node_10.x $DISTRO main" >> /etc/apt/sources.list.d/nodesource.list &&     echo "deb-src https://deb.nodesource.com/node_10.x $DISTRO main" >> /etc/apt/sources.list.d/nodesource.list
 ---> Using cache
 ---> 128d1ae635b6
Step 15/44 : RUN apt-get -qq update &&     apt-get -qq install --yes --no-install-recommends        less    nodejs        unzip        > /dev/null &&     apt-get -qq purge &&     apt-get -qq clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 5bb84dca03d6
Step 16/44 : EXPOSE 8888
 ---> Using cache
 ---> 1af010bda129
Step 17/44 : ENV APP_BASE /srv
 ---> Using cache
 ---> 015efe9eaf03
Step 18/44 : ENV NPM_DIR ${APP_BASE}/npm
 ---> Using cache
 ---> 152da49fbce8
Step 19/44 : ENV NPM_CONFIG_GLOBALCONFIG ${NPM_DIR}/npmrc
 ---> Using cache
 ---> 537762385c84
Step 20/44 : ENV CONDA_DIR ${APP_BASE}/conda
 ---> Using cache
 ---> afe392763a3d
Step 21/44 : ENV NB_PYTHON_PREFIX ${CONDA_DIR}
 ---> Using cache
 ---> 382122268dcc
Step 22/44 : ENV KERNEL_PYTHON_PREFIX ${NB_PYTHON_PREFIX}
 ---> Using cache
 ---> 18f0c1167cc8
Step 23/44 : ENV PATH ${CONDA_DIR}/bin:${NPM_DIR}/bin:${PATH}
 ---> Using cache
 ---> 0c35fe554388
Step 24/44 : COPY conda/install-miniconda.bash /tmp/install-miniconda.bash
 ---> Using cache
 ---> e7ca95dbadaf
Step 25/44 : COPY conda/environment.py-3.7.frozen.yml /tmp/environment.yml
 ---> Using cache
 ---> 6a53125296df
Step 26/44 : RUN mkdir -p ${NPM_DIR} && chown -R ${NB_USER}:${NB_USER} ${NPM_DIR}
 ---> Using cache
 ---> 7bb2261b8c4e
Step 27/44 : USER ${NB_USER}
 ---> Using cache
 ---> 67db6f602037
Step 28/44 : RUN npm config --global set prefix ${NPM_DIR}
 ---> Using cache
 ---> b13da8d472b9
Step 29/44 : USER root
 ---> Using cache
 ---> 247b0fe2ba13
Step 30/44 : RUN bash /tmp/install-miniconda.bash && rm /tmp/install-miniconda.bash /tmp/environment.yml
 ---> Using cache
 ---> 6106f398136d
Step 31/44 : ARG REPO_DIR=${HOME}
 ---> Using cache
 ---> 5f272ae52e5b
Step 32/44 : ENV REPO_DIR ${REPO_DIR}
 ---> Using cache
 ---> 3d3d88d89c36
Step 33/44 : WORKDIR ${REPO_DIR}
 ---> Using cache
 ---> a14cf6460bfe
Step 34/44 : ENV PATH ${HOME}/.local/bin:${REPO_DIR}/.local/bin:${PATH}
 ---> Using cache
 ---> d578c461852f
Step 35/44 : USER root
 ---> Using cache
 ---> 3ada60f44fa9
Step 36/44 : COPY src/ ${REPO_DIR}
 ---> 0b603a66c55c
Step 37/44 : RUN chown -R ${NB_USER}:${NB_USER} ${REPO_DIR}
 ---> Running in 6ca7049264d5
Removing intermediate container 6ca7049264d5
 ---> 5f8ce9fe3063
Step 38/44 : USER ${NB_USER}
 ---> Running in 313d594d0834
Removing intermediate container 313d594d0834
 ---> fd4fa76f2391
Step 39/44 : RUN pip install "pip<19" && ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r "requirements.txt"
 ---> Running in a5ec8ce350ee
Collecting pip<19
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-18.1
Collecting cython>=0.21 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ab/1b/85223a9d7d39ea8d0dec76785ef5e2aa7a82a3eaa92cb7becd2a64cef663/Cython-0.29.6-cp37-cp37m-manylinux1_x86_64.whl (2.1MB)
Collecting numpy>=1.8 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/91/e7/6c780e612d245cca62bc3ba8e263038f7c144a96a54f877f3714a0e8427e/numpy-1.16.2-cp37-cp37m-manylinux1_x86_64.whl (17.3MB)
Collecting scipy>=0.14 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/3e/7e/5cee36eee5b3194687232f6150a89a38f784883c612db7f4da2ab190980d/scipy-1.2.1-cp37-cp37m-manylinux1_x86_64.whl (24.8MB)
Collecting matplotlib>=1.2 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/83/2a/e47bbd9396af32376863a426baed62d9bf3091f81defd1fe81c5f33b11a3/matplotlib-3.0.3-cp37-cp37m-manylinux1_x86_64.whl (13.0MB)
Collecting qutip>=3.1 (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/02/fa/c815ed3f060ed96a56843dfdd1b9b68dd4d9924f7e255845c71d9f62d7d1/qutip-4.3.1.tar.gz (5.5MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-cv49njvv/qutip/setup.py", line 54, in <module>
        from Cython.Build import cythonize
    ModuleNotFoundError: No module named 'Cython'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-cv49njvv/qutip/
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Removing intermediate container a5ec8ce350ee
The command '/bin/sh -c pip install "pip<19" && ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r "requirements.txt"' returned a non-zero code: 1

There is the option of using an environment.yml file that uses conda, specifying pip inside it.
So far I was able to make it work only with a super-ugly hack:

  • using an environment.yml installing dependencies besides qutip
  • launching a conda install of qutip inside the jupyter notebook (a pip install fails).

The issue reported above occurs also by updating the requirements.txt to more recent versions of dependencies and qutip itself. There are similar open issues online, also regarding scikit-learn. Adding a runtime.txt for python-3.5, as suggested online, did not help.

Also an environment.yml file like

name: Qutip-env
dependencies:
- python==3.6
- pip=18
- matplotlib
- nbconvert
- notebook
- ipywidgets
- pip:
  - cython
  - qutip

does not help. I am looking into this.

Different values of similar functions

In the following notebook the result of this line

_overlap(result.U_f, U_f_numerical).real, abs(_overlap(result.U_f, U_f_numerical))**2

(which is in the "Test numerical integration of GRAPE pulse") the result obtained seems very low.
Why would the unitary obtained by the propagator function "U_f_numerical" be so different from that derived from the cy_grape_unitary function "result.U_f"?
They are both derived from "result.H_t". I am saying that they seem to be different based on the low value "0.11355125771393167" of the _overlap function. I may be totally wrong about this.

mybinder - updating

@nonhermitian The new binder thing is awesome! Great find
How is it updated? As in when we get a fix for the version table issue done, how do we update the mybinder configuration.

I guess we should put a badge on this readme as well, and on the QuTiP website. Everyone agree?

Errors when drawing Circuits

Whenever I try to show a circuit for example
qc0.png
I get the messages
`FileNotFoundError Traceback (most recent call last)
in ()
3 qc0 = QubitCircuit(N)
4 qc0.add_gate("SWAP", [0, 1], None)
----> 5 qc0.png

/home/jhellmers/anaconda3/lib/python3.6/site-packages/qutip/qip/circuit.py in png(self)
1012 def png(self):
1013 from IPython.display import Image
-> 1014 return Image(self.repr_png(), embed=True)
1015
1016 @Property

/home/jhellmers/anaconda3/lib/python3.6/site-packages/qutip/qip/circuit.py in repr_png(self)
1004
1005 def repr_png(self):
-> 1006 return _latex_compile(self.latex_code(), format="png")
1007
1008 def repr_svg(self):

/home/jhellmers/anaconda3/lib/python3.6/site-packages/qutip/qip/circuit_latex.py in _latex_compile(code, filename, format)
60 os.system("convert -density %s %s.pdf %s.png" % (100, filename,
61 filename))
---> 62 with open("%s.png" % filename, "rb") as f:
63 result = f.read()
64 else:

FileNotFoundError: [Errno 2] No such file or directory: 'qcirc.png'`

Apparently a file called qcirc.png was supposed to be generated but wasn't.

Parallel examples in tutorial notebooks do not work

I simply don't see how tutorial examples involving parallel computations can work. If one executes any of these examples whether involving the parfor() function or the more formal pool.map construct one gets into AttributeError for not being able to access the called function explicitly defined above. If one puts these functions in a file and import, the Attributeerror goes away but then the called arguments are not global and the program cannot resolve them. The simple appearance of these parallel executions in the examples hides some pre-requisite or built in assumptions not shown that made these parallel examples useless. I am afraid I am not the only one trying to learn QuTip but ending up wasting a lot of time unnecessarily, which could have been avoided with a more carefully prepared tutorial.

I have tried these both in the nteract environment and in browser based Jupyter. None worked. It would save the beginning users a lot of time if these examples could be more explicit with what underlying environmental setup was involved before these innocent looking parallel calls can actually work.

jupyter notebook example bloch-sphere-animation - matplotlib.animation:MovieWriter avconv unavailable

OS: MacOS High sierra
Python: Python 3.6.5 :: Anaconda, Inc.

I installed qutip using conda

When I run python and the following

from qutip import *
about()

I get

QuTiP: Quantum Toolbox in Python
Copyright (c) 2011 and later.
A. J. Pitchford, P. D. Nation, R. J. Johansson, A. Grimsmo, and C. Granade

QuTiP Version: 4.3.1
Numpy Version: 1.14.3
Scipy Version: 1.1.0
Cython Version: 0.28.2
Matplotlib Version: 2.2.2
Python Version: 3.6.5
Number of CPUs: 4
BLAS Info: INTEL MKL
OPENMP Installed: False
INTEL MKL Ext: True
Platform Info: Darwin (x86_64)
Installation path: /Users/xxx/anaconda3/lib/python3.6/site-packages/qutip

Then I launch the jupyter notebook and run 'bloch-sphere-animation.ipynb'

plot_animation(plot_setup, plot_result, result)

I get this

WARNING:matplotlib.animation:MovieWriter avconv unavailable.

KeyError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/PIL/Image.py in save(self, fp, format, **params)
1914 try:
-> 1915 format = EXTENSION[ext]
1916 except KeyError:

KeyError: '.mp4'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
in ()
----> 1 plot_animation(plot_setup, plot_result, result)

qutip.piqs notebooks consistency of factor 0.5

In the text and tables of the qutip.piqs notebooks there is sometimes a confusing factor 1/2.

Both Dicke.lindbladian() and Dicke.liouvillian() actually implement
$\gamma L[A] =\gamma ( A \rho A^\dagger -A^\dagger A \rho -\rho A^\dagger A)$
,
such that defining a rate ($\gamma$) as in the text gives the corresponding Liouvillian / Lindbladian.

Tutorials on matplotlib, numpy are outdated

A few semantic changes have occurred over the years for both the libraries however, the brief tutorials on the website are outdated. One such example is:

from numpy import *
a = array([1,2,3,4,5,6])
print(a)

The above code semantics is outdated and should be the following instead:

import numpy as np
a = np.array([1,2,3,4,5,6])
print(a)

The outdated code might not be just limited to the aforementioned libraries. These were the only tutorials I happened to check.

I understand that this code works but it's just good practice to import numpy as np instead of from numpy import * and so on.

Getting an deprecation warning

When executing
W, THETA, PHI = spin_wigner(psi, theta, phi)
I get the message
/home/jhellmers/anaconda3/lib/python3.6/site-packages/scipy/sparse/compressed.py:845: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future start = self.indptr[major_index] /home/jhellmers/anaconda3/lib/python3.6/site-packages/scipy/sparse/compressed.py:846: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future end = self.indptr[major_index+1]

This was in the Adiabatic Quantum Computing lecture notebook.

Relicense notebooks to BSD license

As part of the GSoC QuTiP notebooks upgrade, I discovered that the qutip-notebooks are licensed under the LGPL. This was likely a mistake made ages ago (2013) and I would like to propose that we relicense the notebooks to the BSD license. Reasons and what's entailed follow:

Why relicense?

  • The LGPL license is a GPL license with an exception that allows software to link to a library at run-time without also having to be (L)GPLed. The qutip-notebooks repository doesn't contain a library.
  • qutip and our other Python packages use the BSD licenses, which is not a copyleft license.
  • As things stand, we don't have permission to use code from qutip-notebooks in qutip itself, and no one using qutip-notebooks could distribute copied or modified versions of code from qutip-notebooks without also licensing their work as LGPL.
  • I don't think this situation makes much sense and I don't think it's what we or many of our users want. Currently our users would have to license their wrork as (L)GPL if they used a snippet of code from an example notebook.

What's required to make the change?

  • Since the LGPL doesn't grant us the freedom to distribute the notebook under a BSD license, we'll need to ask all contributors for permission to release their work under a BSD license.
  • Luckily there are only ~15 contributors, and most of them are contactable.
  • If we can't contact everyone, we can not re-license the specific notebooks affected (hopefully a small number).

License change PR

  • See #145 for the PR proposing the change to the BSD license.

Re-licensing checklist

Below is a check list of the contributors we need to get permission to relicense from (in order of number of commits at the time of making the list):

In order to check someone off the list, they need to agree in writing to have their contributions released under the BSD license, preferably by write a comment on this issue stating "I agree to have my contributions to the qutip-notebooks released under the BSD license."

Cannot open optimal control examples.

Whenever I'm trying to open any of the optimal control examples in GitHub, I get an error saying something went wrong. Anyone knows what is going on with these examples ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.