pqca


Namepqca JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/hmillerbakewell/partitioned-quantum-cellular-automata
SummaryConstruct and simulate partitioned quantum cellular automata
upload_time2023-03-16 08:35:17
maintainer
docs_urlNone
authorHector Miller-Bakewell
requires_python>=3.8
license
keywords quantum computing cellular automata
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PQCA (Partitioned Quantum Cellular Automata)

A quantum cellular automaton iteratively applies some update circuit to some initial state.
A partitioned quantum cellular automaton (PQCA) derives its update circuit by partitioning
a lattice of qubits into cells, and then applying the same circuit to each cell.
The full update circuit is created by composing several such partitioned updates.
There is a review of Quantum Cellular Automata by Terry Farrelly, published in Quantum, and available at [doi:10.22331/q-2020-11-30-368](https://doi.org/10.22331/q-2020-11-30-368).

This python module allows for the easy creation and execution of partitioned quantum cellular automata.
To create an automaton you will need:
 - A starting state (list of 0s and 1s)
 - Update Frames (see `pqca.update_frame`)
 - A simulator / quantum computer (see `pqca.backend`)

An Update Frame combines a tessellation with a circuit to be applied
to each cell in that tessellation.
A tessellation just partitions a list of qubits into cells. For example
`pqca.tessellation.one_dimensional(10,2)`
partitions 10 qubits into 5 cells, each of size 2.
The Update Frame would then need to be a circuit on 2 qubits.
For more complicated tessellations you can use, e.g.
`pqca.tessellation.n_dimensional([4,2,4],[2,2,2])`
which partitions 32 qubits as though they were arranged in a lattice
of shape `4 x 2 x 4`, with each cell of size `2 x 2 x 2`.
The Update Frame would then need to be a circuit on 8 qubits.

One can then call `next(automaton)` which will advance the internal state of the automaton and return the new state.

## Installation

Install via `pip` from the command line with the command:
```
pip install pqca
```

## Example

Here is an example that creates two update frames,
both applying a simple CX gate, but with offset tessellations.
```python
# Create circuit
cx_circuit = qiskit.QuantumCircuit(2)
cx_circuit.cx(0, 1)

# Create tessellation
tes = pqca.tessellation.one_dimensional(10, 2)

# Create update frames
update_1 = pqca.UpdateFrame(tes, cx_circuit)
update_2 = pqca.UpdateFrame(tes.shifted_by(1), cx_circuit)


# Create initial state
initial_state = [1]*10

# Specify a backend; `pqca.backend.qiskit()` returns IBM's Aer simulator by default
# See backend.py for more details and instructions on coding your own backend
backend = pqca.backend.qiskit()

# Create the automaton
automaton = pqca.Automaton(initial_state, [update_1, update_2], backend)

# The automaton can be called like any other iterator
# The following line advances the internal state, and returns the new state
next(automaton)
```

## Documentation

Detailed documentation can be found at [readthedocs.io](https://partitioned-quantum-cellular-automata.readthedocs.io/en/latest/) as well as
in the docstrings of the python files themselves.

## Licensing

The source code is available under the MIT licence and can be found
on [Hector Miller-Bakewell's github](https://github.com/hmillerbakewell/partitioned-quantum-cellular-automata).

## Acknowledgements

This package was created as part of the [QuTune Project](https://iccmr-quantum.github.io/).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hmillerbakewell/partitioned-quantum-cellular-automata",
    "name": "pqca",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "quantum computing,cellular automata",
    "author": "Hector Miller-Bakewell",
    "author_email": "hmillerbakewell@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3e/73/937282cd0aa868359e9dcffcf3b51b9473caf846594c31404c0b6018a701/pqca-1.0.3.tar.gz",
    "platform": null,
    "description": "# PQCA (Partitioned Quantum Cellular Automata)\n\nA quantum cellular automaton iteratively applies some update circuit to some initial state.\nA partitioned quantum cellular automaton (PQCA) derives its update circuit by partitioning\na lattice of qubits into cells, and then applying the same circuit to each cell.\nThe full update circuit is created by composing several such partitioned updates.\nThere is a review of Quantum Cellular Automata by Terry Farrelly, published in Quantum, and available at [doi:10.22331/q-2020-11-30-368](https://doi.org/10.22331/q-2020-11-30-368).\n\nThis python module allows for the easy creation and execution of partitioned quantum cellular automata.\nTo create an automaton you will need:\n - A starting state (list of 0s and 1s)\n - Update Frames (see `pqca.update_frame`)\n - A simulator / quantum computer (see `pqca.backend`)\n\nAn Update Frame combines a tessellation with a circuit to be applied\nto each cell in that tessellation.\nA tessellation just partitions a list of qubits into cells. For example\n`pqca.tessellation.one_dimensional(10,2)`\npartitions 10 qubits into 5 cells, each of size 2.\nThe Update Frame would then need to be a circuit on 2 qubits.\nFor more complicated tessellations you can use, e.g.\n`pqca.tessellation.n_dimensional([4,2,4],[2,2,2])`\nwhich partitions 32 qubits as though they were arranged in a lattice\nof shape `4 x 2 x 4`, with each cell of size `2 x 2 x 2`.\nThe Update Frame would then need to be a circuit on 8 qubits.\n\nOne can then call `next(automaton)` which will advance the internal state of the automaton and return the new state.\n\n## Installation\n\nInstall via `pip` from the command line with the command:\n```\npip install pqca\n```\n\n## Example\n\nHere is an example that creates two update frames,\nboth applying a simple CX gate, but with offset tessellations.\n```python\n# Create circuit\ncx_circuit = qiskit.QuantumCircuit(2)\ncx_circuit.cx(0, 1)\n\n# Create tessellation\ntes = pqca.tessellation.one_dimensional(10, 2)\n\n# Create update frames\nupdate_1 = pqca.UpdateFrame(tes, cx_circuit)\nupdate_2 = pqca.UpdateFrame(tes.shifted_by(1), cx_circuit)\n\n\n# Create initial state\ninitial_state = [1]*10\n\n# Specify a backend; `pqca.backend.qiskit()` returns IBM's Aer simulator by default\n# See backend.py for more details and instructions on coding your own backend\nbackend = pqca.backend.qiskit()\n\n# Create the automaton\nautomaton = pqca.Automaton(initial_state, [update_1, update_2], backend)\n\n# The automaton can be called like any other iterator\n# The following line advances the internal state, and returns the new state\nnext(automaton)\n```\n\n## Documentation\n\nDetailed documentation can be found at [readthedocs.io](https://partitioned-quantum-cellular-automata.readthedocs.io/en/latest/) as well as\nin the docstrings of the python files themselves.\n\n## Licensing\n\nThe source code is available under the MIT licence and can be found\non [Hector Miller-Bakewell's github](https://github.com/hmillerbakewell/partitioned-quantum-cellular-automata).\n\n## Acknowledgements\n\nThis package was created as part of the [QuTune Project](https://iccmr-quantum.github.io/).\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Construct and simulate partitioned quantum cellular automata",
    "version": "1.0.3",
    "split_keywords": [
        "quantum computing",
        "cellular automata"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04225bf7727daf6fd396501c8a7b860f1d0ce4438a2118c376bee4c2a22c4c71",
                "md5": "8464f7255b9ffe17584ba832361e7bef",
                "sha256": "a117c3f1ce4d239a58023aec5337ecf353cf60fd331a0be1b195c31205b9a2b9"
            },
            "downloads": -1,
            "filename": "pqca-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8464f7255b9ffe17584ba832361e7bef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14254,
            "upload_time": "2023-03-16T08:35:15",
            "upload_time_iso_8601": "2023-03-16T08:35:15.740294Z",
            "url": "https://files.pythonhosted.org/packages/04/22/5bf7727daf6fd396501c8a7b860f1d0ce4438a2118c376bee4c2a22c4c71/pqca-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e73937282cd0aa868359e9dcffcf3b51b9473caf846594c31404c0b6018a701",
                "md5": "0f8451b153e764e8b0dd9bf5caddf5dd",
                "sha256": "3045ca6fec95d071fb4d438c3f46001ca1e7b6d18e1756043d7044b96da6bc4d"
            },
            "downloads": -1,
            "filename": "pqca-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0f8451b153e764e8b0dd9bf5caddf5dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11849,
            "upload_time": "2023-03-16T08:35:17",
            "upload_time_iso_8601": "2023-03-16T08:35:17.448476Z",
            "url": "https://files.pythonhosted.org/packages/3e/73/937282cd0aa868359e9dcffcf3b51b9473caf846594c31404c0b6018a701/pqca-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-16 08:35:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hmillerbakewell",
    "github_project": "partitioned-quantum-cellular-automata",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pqca"
}
        
Elapsed time: 0.09958s