jaxquantum


Namejaxquantum JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/EQuS/jaxquantum
Summaryjaxquantum
upload_time2024-03-04 10:49:58
maintainer
docs_urlNone
authorShantanu Jha, Shoumik Chowdhury, Max Hays
requires_python>=3.7
licenseApache 2.0
keywords quantum computing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
    <img src="./docs/assets/logo.png" height="120" alt="jaxquantum logo">
</h1>


[![License](https://img.shields.io/github/license/EQuS/jaxquantum.svg?style=popout-square)](https://opensource.org/license/apache-2-0) [![](https://img.shields.io/github/release/EQuS/jaxquantum.svg?style=popout-square)](https://github.com/EQuS/jaxquantum/releases) [![](https://img.shields.io/pypi/dm/jaxquantum.svg?style=popout-square)](https://pypi.org/project/jaxquantum/)

[S. R. Jha](https://github.com/Phionx), [S. Chowdhury](https://github.com/shoumikdc), [M. Hays](https://scholar.google.com/citations?user=06z0MjwAAAAJ), [J. A. Grover](https://scholar.google.com/citations?user=igewch8AAAAJ), [W. D. Oliver](https://scholar.google.com/citations?user=4vNbnqcAAAAJ&hl=en)

***Docs:** [https://equs.github.io/jaxquantum](https://equs.github.io/jaxquantum)

`jaxquantum` leverages [JAX](https://github.com/google/jax) to enable the auto differentiable and (CPU, GPU, TPU) accelerated simulation of quantum dynamical systems, including tooling such as operator construction, unitary evolution and master equation solving. As such, `jaxquantum` serves as a QuTiP drop-in replacement written entirely in JAX.

This package also serves as an essential dependency for [`bosonic-jax`](https://github.com/EQuS/bosonic-jax) and [`qcsys`](https://github.com/EQuS/qcsys). Together, these packages form an end-to-end toolkit for quantum circuit design, simulation and control. 


## Installation

`jaxquantum` is published on PyPI. So, to install the latest version from PyPI, simply run the following code to install the package:

```bash
pip install jaxquantum
```

For more details, please visit the getting started > installation section of our [docs](https://equs.github.io/jaxquantum/getting_started/installation.html).

## An Example

Here's an example of how to set up a simulation in jaxquantum.

```
from jax import jit
import jaxquantum as jqt
import jax.numpy as jnp
import matplotlib.pyplot as plt

omega_q = 5.0 #GHz
Omega = .1
g_state = jqt.basis(2,0) ^ jqt.basis(2,0)
g_state_dm = g_state.to_dm()

ts = jnp.linspace(0,5*jnp.pi/Omega,101)
c_ops = [0.1*jqt.sigmam()^jqt.identity(N=2)]

sz0 = jqt.sigmaz() ^ jqt.identity(N=2)

@jit
def Ht(t):
    H0 = omega_q/2.0*((jqt.sigmaz()^jqt.identity(N=2)) + (jqt.identity(N=2)^jqt.sigmaz()))
    H1 = Omega*jnp.cos((omega_q)*t)*((jqt.sigmax()^jqt.identity(N=2)) + (jqt.identity(N=2)^jqt.sigmax()))
    return H0 + H1


states = jqt.mesolve(g_state_dm, ts, c_ops=c_ops, Ht=Ht) 
szt = jnp.real(jqt.calc_expect(sz0, states))


fig, ax = plt.subplots(1, dpi=200, figsize=(4,3))
ax.plot(ts, szt)
ax.set_xlabel("Time (ns)")
ax.set_ylabel("<σz(t)>")
fig.tight_layout()
```

## Acknowledgements & History

**Core Devs:** [Shantanu A. Jha](https://github.com/Phionx), [Shoumik Chowdhury](https://github.com/shoumikdc)


This package was initially a small part of [`bosonic-jax`](https://github.com/EQuS/bosonic-jax). In early 2022, `jaxquantum` was extracted and made into its own package. This package was briefly announced to the world at APS March Meeting 2023 and released to a select few academic groups shortly after. Since then, this package has been open sourced and developed while conducting research in the Engineering Quantum Systems Group at MIT with invaluable advice from [Prof. William D. Oliver](https://equs.mit.edu/william-d-oliver/). 

## Citation

Thank you for taking the time to try our package out. If you found it useful in your research, please cite us as follows:

``` 
@unpublished{jha2024jaxquantum,
  title  = {An auto differentiable and hardware accelerated software toolkit for quantum circuit design, simulation and control},
  author = {Shantanu R. Jha, Shoumik Chowdhury, Max Hays, Jeff A. Grover, William D. Oliver},
  year   = {2024},
  url    = {https://github.com/EQuS/jaxquantum, https://github.com/EQuS/bosonic-jax, https://github.com/EQuS/qcsys}
}
```
> S. R. Jha, S. Chowdhury, M. Hays, J. A. Grover, W. D. Oliver. An auto differentiable and hardware accelerated software toolkit for quantum circuit design, simulation and control (2024), in preparation.


## Contributions & Contact

This package is open source and, as such, very open to contributions. Please don't hesitate to open an issue, report a bug, request a feature, or create a pull request. We are also open to deeper collaborations to create a tool that is more useful for everyone. If a discussion would be helpful, please email [shanjha@mit.edu](mailto:shanjha@mit.edu) to set up a meeting. 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EQuS/jaxquantum",
    "name": "jaxquantum",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "quantum computing",
    "author": "Shantanu Jha, Shoumik Chowdhury, Max Hays",
    "author_email": "shantanu.rajesh.jha@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/80/4f2518b7f4a7878abc94e7695f8b0746c3ec030870af592d9887b54d7d80/jaxquantum-0.1.0.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\n    <img src=\"./docs/assets/logo.png\" height=\"120\" alt=\"jaxquantum logo\">\n</h1>\n\n\n[![License](https://img.shields.io/github/license/EQuS/jaxquantum.svg?style=popout-square)](https://opensource.org/license/apache-2-0) [![](https://img.shields.io/github/release/EQuS/jaxquantum.svg?style=popout-square)](https://github.com/EQuS/jaxquantum/releases) [![](https://img.shields.io/pypi/dm/jaxquantum.svg?style=popout-square)](https://pypi.org/project/jaxquantum/)\n\n[S. R. Jha](https://github.com/Phionx), [S. Chowdhury](https://github.com/shoumikdc), [M. Hays](https://scholar.google.com/citations?user=06z0MjwAAAAJ), [J. A. Grover](https://scholar.google.com/citations?user=igewch8AAAAJ), [W. D. Oliver](https://scholar.google.com/citations?user=4vNbnqcAAAAJ&hl=en)\n\n***Docs:** [https://equs.github.io/jaxquantum](https://equs.github.io/jaxquantum)\n\n`jaxquantum` leverages [JAX](https://github.com/google/jax) to enable the auto differentiable and (CPU, GPU, TPU) accelerated simulation of quantum dynamical systems, including tooling such as operator construction, unitary evolution and master equation solving. As such, `jaxquantum` serves as a QuTiP drop-in replacement written entirely in JAX.\n\nThis package also serves as an essential dependency for [`bosonic-jax`](https://github.com/EQuS/bosonic-jax) and [`qcsys`](https://github.com/EQuS/qcsys). Together, these packages form an end-to-end toolkit for quantum circuit design, simulation and control. \n\n\n## Installation\n\n`jaxquantum` is published on PyPI. So, to install the latest version from PyPI, simply run the following code to install the package:\n\n```bash\npip install jaxquantum\n```\n\nFor more details, please visit the getting started > installation section of our [docs](https://equs.github.io/jaxquantum/getting_started/installation.html).\n\n## An Example\n\nHere's an example of how to set up a simulation in jaxquantum.\n\n```\nfrom jax import jit\nimport jaxquantum as jqt\nimport jax.numpy as jnp\nimport matplotlib.pyplot as plt\n\nomega_q = 5.0 #GHz\nOmega = .1\ng_state = jqt.basis(2,0) ^ jqt.basis(2,0)\ng_state_dm = g_state.to_dm()\n\nts = jnp.linspace(0,5*jnp.pi/Omega,101)\nc_ops = [0.1*jqt.sigmam()^jqt.identity(N=2)]\n\nsz0 = jqt.sigmaz() ^ jqt.identity(N=2)\n\n@jit\ndef Ht(t):\n    H0 = omega_q/2.0*((jqt.sigmaz()^jqt.identity(N=2)) + (jqt.identity(N=2)^jqt.sigmaz()))\n    H1 = Omega*jnp.cos((omega_q)*t)*((jqt.sigmax()^jqt.identity(N=2)) + (jqt.identity(N=2)^jqt.sigmax()))\n    return H0 + H1\n\n\nstates = jqt.mesolve(g_state_dm, ts, c_ops=c_ops, Ht=Ht) \nszt = jnp.real(jqt.calc_expect(sz0, states))\n\n\nfig, ax = plt.subplots(1, dpi=200, figsize=(4,3))\nax.plot(ts, szt)\nax.set_xlabel(\"Time (ns)\")\nax.set_ylabel(\"<\u03c3z(t)>\")\nfig.tight_layout()\n```\n\n## Acknowledgements & History\n\n**Core Devs:** [Shantanu A. Jha](https://github.com/Phionx), [Shoumik Chowdhury](https://github.com/shoumikdc)\n\n\nThis package was initially a small part of [`bosonic-jax`](https://github.com/EQuS/bosonic-jax). In early 2022, `jaxquantum` was extracted and made into its own package. This package was briefly announced to the world at APS March Meeting 2023 and released to a select few academic groups shortly after. Since then, this package has been open sourced and developed while conducting research in the Engineering Quantum Systems Group at MIT with invaluable advice from [Prof. William D. Oliver](https://equs.mit.edu/william-d-oliver/). \n\n## Citation\n\nThank you for taking the time to try our package out. If you found it useful in your research, please cite us as follows:\n\n``` \n@unpublished{jha2024jaxquantum,\n  title  = {An auto differentiable and hardware accelerated software toolkit for quantum circuit design, simulation and control},\n  author = {Shantanu R. Jha, Shoumik Chowdhury, Max Hays, Jeff A. Grover, William D. Oliver},\n  year   = {2024},\n  url    = {https://github.com/EQuS/jaxquantum, https://github.com/EQuS/bosonic-jax, https://github.com/EQuS/qcsys}\n}\n```\n> S. R. Jha, S. Chowdhury, M. Hays, J. A. Grover, W. D. Oliver. An auto differentiable and hardware accelerated software toolkit for quantum circuit design, simulation and control (2024), in preparation.\n\n\n## Contributions & Contact\n\nThis package is open source and, as such, very open to contributions. Please don't hesitate to open an issue, report a bug, request a feature, or create a pull request. We are also open to deeper collaborations to create a tool that is more useful for everyone. If a discussion would be helpful, please email [shanjha@mit.edu](mailto:shanjha@mit.edu) to set up a meeting. \n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "jaxquantum",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://equs.github.io/jaxquantum",
        "Homepage": "https://github.com/EQuS/jaxquantum",
        "Source Code": "https://github.com/EQuS/jaxquantum",
        "Tutorials": "https://github.com/EQuS/jaxquantum/tree/main/tutorials"
    },
    "split_keywords": [
        "quantum",
        "computing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f804f2518b7f4a7878abc94e7695f8b0746c3ec030870af592d9887b54d7d80",
                "md5": "55065ee45200b3e97af4fa7ecf344ab8",
                "sha256": "8cfde89f070f129c17097b2a373cec34670dc8eda51f6855a136e1bc1742d3ac"
            },
            "downloads": -1,
            "filename": "jaxquantum-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "55065ee45200b3e97af4fa7ecf344ab8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 111104,
            "upload_time": "2024-03-04T10:49:58",
            "upload_time_iso_8601": "2024-03-04T10:49:58.794260Z",
            "url": "https://files.pythonhosted.org/packages/5f/80/4f2518b7f4a7878abc94e7695f8b0746c3ec030870af592d9887b54d7d80/jaxquantum-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-04 10:49:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EQuS",
    "github_project": "jaxquantum",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jaxquantum"
}
        
Elapsed time: 0.38829s