No project description provided
Project description
Qamomile
Qamomile is a powerful SDK designed for quantum optimization algorithms, specializing in the conversion of mathematical models into quantum circuits. It serves as a bridge between classical optimization problems and quantum computing solutions.
Documentation: https://jij-inc.github.io/Qamomile/
Features
- Versatile Compatibility: Supports leading quantum circuit SDKs including Qiskit and QuriParts.
- Advanced Algorithm Support: Implements sophisticated encoding and algorithms like QAOA and QRAO.
- Flexible Model Conversion: Utilizes JijModeling for describing mathematical models and converting them to various quantum circuit SDKs.
- Intermediate Representation: Capable of representing both Hamiltonians and quantum circuits as intermediate forms.
- Standalone Functionality: Can implement quantum circuits independently, similar to other quantum circuit SDKs.
Installation
To install Qamomile, use pip:
pip install qamomile
For optional dependencies:
pip install qamomile[qiskit] # For Qiskit integration
pip install qamomile[quri-parts] # For QuriParts integration
Quick Start
Here's a simple example of how to use Qamomile with QAOA:
import jijmodeling as jm
import jijmodeling_transpiler as jmt
from qamomile.core.qaoa import QAOAConverter
from qamomile.qiskit.transpiler import QiskitTranspiler
# Define QUBO problem
Q = jm.Placeholder("Q", ndim=2)
n = Q.len_at(0, latex="n")
x = jm.BinaryVar("x", shape=(n,))
problem = jm.Problem("qubo")
i, j = jm.Element("i", n), jm.Element("j", n)
problem += jm.sum([i, j], Q[i, j] * x[i] * x[j])
# Prepare instance data
instance_data = {"Q": [[0.1, 0.2, -0.1], [0.2, 0.3, 0.4], [-0.1, 0.4, 0.0]]}
# Compile the problem
compiled_instance = jmt.compile_model(problem, instance_data)
# Create QAOA converter
qaoa_converter = QAOAConverter(compiled_instance)
# Create Qiskit transpiler
qiskit_transpiler = QiskitTranspiler()
# Get QAOA circuit
p = 2 # Number of QAOA layers
qaoa_circuit = qaoa_converter.get_qaoa_ansatz(p)
# Convert to Qiskit circuit
qiskit_circuit = qiskit_transpiler.transpile_circuit(qaoa_circuit)
# ... (continue with quantum execution and result processing)
Documentation
For more detailed information, please refer to our documentation.
Contributing
We welcome contributions! Please see our Contributing Guide for more details.
License
Qamomile is released under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qamomile-0.2.1.tar.gz
.
File metadata
- Download URL: qamomile-0.2.1.tar.gz
- Upload date:
- Size: 23.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c1819b9562915bb04d0616a5230038928deac75df28efdb50070bc3545c1222 |
|
MD5 | 0962d74b1128ea222dbd53ad930944f4 |
|
BLAKE2b-256 | 556920e6db1f56ecbf6d877bb1f1f37caf1abb0d80646b79296fdd4cc2ac329e |
File details
Details for the file qamomile-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: qamomile-0.2.1-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aee23680c1e8ab5e84830e53ef6635ab21bcaba6b8d9fb41d2c0c1183da8a1a |
|
MD5 | fee9d68fa9de59fcef3565c16ce350bd |
|
BLAKE2b-256 | 539145d9daad862d5e81a3f4440c02daedf01cc37849b737bd1c360b0aa4538c |