GithubHelp home page GithubHelp logo

qutip-qtrl'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-qtrl's People

Contributors

ajgpitch avatar boxili avatar cgranade avatar eendebakpt avatar eliegouzien avatar ericgig avatar flowerthrower avatar hmyuuu avatar hodgestar avatar jakelishman avatar jakobjakobson13 avatar jrjohansson avatar nathanshammah avatar nonhermitian avatar paniash avatar sameshl avatar spinolino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qutip-qtrl's Issues

Callback option for Optimizer.optim_method

I try to generate some pulses using create_pulse_optimizer() and want to be able to write my own callback function. Can I do that without changing any of the source code?

Separate bounds on each control for GRAPE

Can GRAPE have different bounds on each control?

The docstring for pulseoptim.create_pulse_optimizer states that amp_lbound and amp_ubound can be a list specifying different bounds for each of the controls. But this does not work with the default alg='GRAPE' because when the pulse_generator is created in lines 2087-2097 in pulseoptim.py, a single pulse_generator is used for all controls, but the bounds are still set with amp_lbound and amp_ubound as lists. This will fail because the PulseGen class expects the bounds to be floats, e.g., when bounds checking in _apply_bounds_and_offset. Having a single pulse generator also does not conceptually align with having different bounds on each control. None of this is an issue if amp_lbound and amp_ubound are specified as a single float for all controls, or if alg='CRAB' is used instead because a pulse_generator is created for each control.

The coding fix is simple, but it is unclear whether instantiating a pulse generator for each control, like in CRAB, is still valid for GRAPE.

Below is a simple example that will fail:

from qutip import identity, sigmax, sigmay, sigmaz
from qutip_qip.operations import hadamard_transform
import qutip_qtrl.pulseoptim as cpo

# Drift
H_d = sigmaz()

# Control
H_c = [sigmax(), sigmay()]

# Initial unitary
U_0 = identity(2)

# Target unitary
U_targ = hadamard_transform(N=1)

# Number of time slots
n_ts = 10

# Total time
evo_time = 10

# Bounds
amp_lbound = [-1 for _ in range(len(H_c))]
amp_ubound = [1 for _ in range(len(H_c))]

result = cpo.optimize_pulse_unitary(H_d, H_c, U_0, U_targ, n_ts, evo_time,
                amp_lbound=amp_lbound, amp_ubound=amp_ubound,
                alg='GRAPE')

log_handler setting was removed from qutip master?

I don't fully understand why this is happening. The error emerged suddenly, it wasn't there before.

https://github.com/qutip/qutip-qip/actions/runs/9520446957/job/26247017075

tests/test_compiler.py:7: in <module>
    from qutip_qip.device import (
src/qutip_qip/device/__init__.py:13: in <module>
    from .optpulseprocessor import OptPulseProcessor
src/qutip_qip/device/optpulseprocessor.py:8: in <module>
    import qutip.control.pulseoptim as cpo
/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/qutip_qtrl/pulseoptim.py:65: in <module>
    import qutip_qtrl.optimconfig as optimconfig
/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/qutip_qtrl/optimconfig.py:17: in <module>
    logger = qutip_qtrl.logging_utils.get_logger("qutip.control.optimconfig")
/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/qutip_qtrl/logging_utils.py:69: in get_logger
    policy = settings.log_handler
E   AttributeError: 'Settings' object has no attribute 'log_handler'. Did you mean: '_log_handler'?

Refactoring of optimization to use dense and sparse format of v5 Qobj

Checks like

if dtype == Qobj: ...
if dtype == np.ndarray: ...

can be found all over dynamics.py (and other optimization related files). This is done to distinguish between "dense" and "sparse" representations.
The new data layer structure in v5, however, supports both types within the Qobj class.
Therefore dynamics.py and related tests should be adapted to the v5 changes.

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.