Skip to content

Commit

Permalink
readme and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jue-Xu committed Jul 2, 2024
1 parent 177b1f0 commit 902ed2e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 27 deletions.
52 changes: 43 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,52 @@
<!-- ![Figure](./figs/idea.png) -->
[![License](https://img.shields.io/github/license/qiskit-community/qiskit-algorithms.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)

This python package contains ingredients for quantum simulation, such as the Hamiltonians and algorithm primitives.
This [python package](https://pypi.org/project/quantum-simulation-recipe/) contains ingredients for quantum simulation, such as the Hamiltonians and algorithmic primitives, mainly build on [qiskit](https://www.ibm.com/quantum/qiskit), [openfermion](https://github.com/quantumlib/OpenFermion).

## Usage
## Install
```bash
conda create --name qsenv python=3.10
conda create --name qs python=3.10
pip install quantum-simulation-recipe
```

<!-- ### Requirements
- qiskit version ==
- openfermion
- python (version = 3.10), numpy, scipy, matplotlib, jax -->
## Usage
```python
import quantum_simulation_recipe as qsr
from quantum_simulation_recipe import spin_ham

H = spin_ham.Nearest_Neighbour_1d(4)
H.ham
```
More details
https://github.com/Jue-Xu/Quantum-Simulation-Recipe/tree/main/tests/test.ipynb

## Content
### Common Hamiltonians
- Spin Lattice: nearest-neighbor, power-law, IQP
- Fermion: chemical molecule, SYK
- Boson: Hubbard
- Field: lattice gauge
- open system [todo]

### States
- entangled state: GHZ, W state
- random state (Haar random, one-design)

### Operator
- random Pauli strings
- OTOC

### Channels
- noise channel (depolarize, dephase)

### Measures
- norm: operator, trace distance, fidelity ...
- error bound
- overlap, entanglement, entropy

### Algorithmic primitives
- Trotter-Suzuki (product formula)
- LCU
- QSP
- ITE

## Examples
https://github.com/Jue-Xu/Quantum-Simulation-Recipe/tree/main/tests/test.ipynb
30 changes: 12 additions & 18 deletions tests/test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,33 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 13,
"id": "8c03d3e4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"SparsePauliOp(['IIXX', 'IXXI', 'XXII', 'IIYY', 'IYYI', 'YYII', 'IIZZ', 'IZZI', 'ZZII', 'IIIX', 'IIXI', 'IXII', 'XIII'],\n",
" coeffs=[1. +0.j, 1. +0.j, 1. +0.j, 1. +0.j, 1. +0.j, 1. +0.j, 1. +0.j, 1. +0.j,\n",
" 1. +0.j, 0.2+0.j, 0.2+0.j, 0.2+0.j, 0.2+0.j])"
"[SparsePauliOp(['IIXX', 'IXXI', 'XXII', 'IIIX', 'IIXI', 'IXII', 'XIII'],\n",
" coeffs=[1. +0.j, 1. +0.j, 1. +0.j, 0.2+0.j, 0.2+0.j, 0.2+0.j, 0.2+0.j]),\n",
" SparsePauliOp(['IIYY', 'IYYI', 'YYII'],\n",
" coeffs=[1.+0.j, 1.+0.j, 1.+0.j]),\n",
" SparsePauliOp(['IIZZ', 'IZZI', 'ZZII'],\n",
" coeffs=[1.+0.j, 1.+0.j, 1.+0.j])]"
]
},
"execution_count": 8,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import importlib \n",
"# qsr = importlib.import_module(\"quantum_simulation_recipe\")\n",
"# qsr = importlib.import_module(\"qiskit-algorithms\")\n",
"# qsr = importlib.import_module(\"quantum-simulation-recipe\")\n",
"\n",
"# from jupyter_book import *\n",
"# from quantum_simulation_recipe import *\n",
"import quantum_simulation_recipe as qsr\n",
"# from qiskit_algorithms import *\n",
"# from qutip import *\n",
"# from quantum_simulation_recipe import Nearest_Neighbour_1d\n",
"from quantum_simulation_recipe import *\n",
"from quantum_simulation_recipe import spin_ham\n",
"\n",
"# qsr.Nearest_Neighbour_1d(4)\n",
"spin_ham.Nearest_Neighbour_1d(4).ham"
"H = spin_ham.Nearest_Neighbour_1d(4)\n",
"H.ham\n",
"H.ham_xyz"
]
}
],
Expand Down

0 comments on commit 902ed2e

Please sign in to comment.