11
22
33
4+ ![ Platform] ( https://img.shields.io/badge/platform-Linux-blue )
45[ ![ github repo badge] ( https://img.shields.io/badge/github-repo-000.svg?logo=github&labelColor=gray&color=blue )] ( https://github.com/QuantumApplicationLab/qubops )
5- <!-- [](https://github.com/QuantumApplicationLab/qubops)
6- [](https://www.research-software.nl/software/qubops)
7- [](https://pypi.python.org/project/qubops/) | -->
6+ [ ![ github license badge] ( https://img.shields.io/github/license/QuantumApplicationLab/qubops )] ( https://github.com/QuantumApplicationLab/qubops )
7+ [ ![ Python] ( https://img.shields.io/badge/Python-3.8-informational )] ( https://www.python.org/ )
8+ [ ![ Code style: Black] ( https://img.shields.io/badge/Code%20style-Black-000.svg )] ( https://github.com/psf/black )
9+ [ ![ Tests] ( https://github.com/quantumapplicationlab/qubops/actions/workflows/build.yml/badge.svg )] ( https://github.com/quantumapplicationlab/qubops/actions/workflows/build.yml )
10+ [ ![ Coverage Status] ( https://coveralls.io/repos/github/QuantumApplicationLab/qubops/badge.svg?branch=master )] ( https://coveralls.io/github/QuantumApplicationLab/qubops?branch=master )
811
9- ![ qubols ] ( ./docs/qubols_illustration.png )
12+ ![ qubops ] ( ./docs/qubols_illustration.png )
1013
11- ## Use
14+ ## QUBOPS
1215` qubops ` allows solving polynomial system of equations using a QUBO formalism. An example can be found [ here] ( ./example/qubops.ipynb )
1316
1417## Installation
@@ -20,11 +23,42 @@ git clone https://github.com/QuantumApplicationLab/qubops.git
2023cd qubops
2124python3 -m pip install .
2225```
26+ ## Example
2327
24- <!-- ## Documentation
28+ ``` python
2529
26- Include a link to your project's full documentation here. -->
30+ from qubops.qubops_mixed_vars import QUBOPS_MIXED
31+ from qubops.encodings import PositiveQbitEncoding
32+ from qubops.solution_vector import SolutionVector_V2 as SolutionVector
33+ from qubops.mixed_solution_vector import MixedSolutionVector_V2 as MixedSolutionVector
34+ from dwave.samplers import SteepestDescentSolver
2735
36+ def define_matrices ():
37+ """ function that creates the polynom matrices for the system."""
38+ # see documentation for more information
39+ return matrices
40+
41+ # define the encoding for the first two varialbes
42+ nqbit = 5
43+ step = 0.05
44+ encoding1 = PositiveQbitEncoding(nqbit = nqbit, step = step, offset = 0 , var_base_name = ' x' )
45+ sol_vec1 = SolutionVector(2 , encoding = encoding1)
46+
47+ # define the encoding for the alst two variables
48+ nqbit = 4
49+ step = 0.05
50+ encoding2 = PositiveQbitEncoding(nqbit = nqbit, step = step, offset = 0 , var_base_name = ' x' )
51+ sol_vec2 = SolutionVector(2 , encoding = encoding2)
52+
53+ # define the solution vector
54+ sol_vec = MixedSolutionVector([sol_vec1,sol_vec2])
55+
56+ # instantiat the QUBOPS solver
57+ options = {' num_reads' :10000 , ' sampler' :SteepestDescentSolver()}
58+ qubo = QUBOPS_MIXED(sol_vec, options)
59+ sol = qubo.solve(define_matrices(), strength = 1E5 )
60+
61+ ```
2862## Contributing
2963
3064If you want to contribute to the development of qubops,
0 commit comments