Skip to content

Commit

Permalink
update setup; test
Browse files Browse the repository at this point in the history
include=["qiskit_algorithms"]
  • Loading branch information
Jue-Xu committed Jul 1, 2024
1 parent 6b19c97 commit 2b6667b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 16 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Quantum-Simulation-Recipe

# Quantum Simulation Recipes
<!-- ![Figure](./figs/idea.png) -->

This python package contains ingredients for quantum simulation, such as the Hamiltonians and algorithm primitives.
[![License](https://img.shields.io/github/license/qiskit-community/qiskit-algorithms.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)

## Usage
<!-- - Create python environment `conda create --name myenv python=3.10`
- Install requirements `pip install -r ./code/requirements.txt` -->
```
# Create python environment
conda create --name myenv python=3.10
# Install requirements
pip install -r ./code/requirements.txt
```bash
conda create --name qsenv python=3.10
pip install quantum-simulation-recipe
```

<!-- ### Requirements
- qiskit version ==
- openfermion
- python (version = 3.10), numpy, scipy, matplotlib, jax -->
- python (version = 3.10), numpy, scipy, matplotlib, jax -->

## Examples
https://github.com/Jue-Xu/Quantum-Simulation-Recipe/tree/main/tests/test.ipynb
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ openfermion==1.5.1
openfermionpyscf==0.5
pandas==2.2.2
qiskit==1.0.2
scipy==1.14.0
scipy==1.12.0
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Jue-Xu/quantum-simulation-recipe",
packages=setuptools.find_packages(),
packages=setuptools.find_packages(include=["quantum_simulation_recipe"]),
# package_data={"cf_remote": ["VERSION"]},
# include_package_data=True,
license="Apache-2.0",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: OSI Approved :: Apache Software License",
# "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires=">=3.10",
Expand All @@ -52,7 +54,7 @@
"openfermion >= 1.5.1",
"openfermionpyscf >= 0.5",
"matplotlib >= 3.8.2",
"scipy >= 1.14.0",
"scipy >= 1.12.0",
"numpy >= 1.23.5",
"pandas >= 2.2.2",
],
Expand Down
69 changes: 69 additions & 0 deletions tests/test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "e385a43f",
"metadata": {},
"source": [
"# Test"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "8c03d3e4",
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'quantum-simulation-recipe'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[10], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mimportlib\u001b[39;00m \n\u001b[0;32m----> 2\u001b[0m qsr \u001b[38;5;241m=\u001b[39m \u001b[43mimportlib\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mimport_module\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mquantum-simulation-recipe\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# from jupyter_book import *\u001b[39;00m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# from quantum_simulation_recipe import *\u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqiskit_algorithms\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;241m*\u001b[39m\n",
"File \u001b[0;32m/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/importlib/__init__.py:126\u001b[0m, in \u001b[0;36mimport_module\u001b[0;34m(name, package)\u001b[0m\n\u001b[1;32m 124\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[1;32m 125\u001b[0m level \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[0;32m--> 126\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_bootstrap\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_gcd_import\u001b[49m\u001b[43m(\u001b[49m\u001b[43mname\u001b[49m\u001b[43m[\u001b[49m\u001b[43mlevel\u001b[49m\u001b[43m:\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpackage\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlevel\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m<frozen importlib._bootstrap>:1050\u001b[0m, in \u001b[0;36m_gcd_import\u001b[0;34m(name, package, level)\u001b[0m\n",
"File \u001b[0;32m<frozen importlib._bootstrap>:1027\u001b[0m, in \u001b[0;36m_find_and_load\u001b[0;34m(name, import_)\u001b[0m\n",
"File \u001b[0;32m<frozen importlib._bootstrap>:1004\u001b[0m, in \u001b[0;36m_find_and_load_unlocked\u001b[0;34m(name, import_)\u001b[0m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'quantum-simulation-recipe'"
]
}
],
"source": [
"import importlib \n",
"qsr = importlib.import_module(\"quantum-simulation-recipe\")\n",
"\n",
"# from jupyter_book import *\n",
"from quantum_simulation_recipe import *\n",
"from qiskit_algorithms import *"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.8 ('base')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
},
"vscode": {
"interpreter": {
"hash": "4e8ef2f9fcac0817bca9a7ca376f64f20b4df5ea3bf7af756a50bda7d3557ea6"
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
1 change: 1 addition & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from quantum_simulation_recipe import *

0 comments on commit 2b6667b

Please sign in to comment.