qubops allows solving polynomial system of equations using a QUBO formalism. An example can be found here
To install qubops from GitHub repository, do:
git clone https://github.com/QuantumApplicationLab/qubops.gitcd qubopspython3 -m pip install .fromqubops.qubops_mixed_varsimportQUBOPS_MIXEDfromqubops.encodingsimportPositiveQbitEncodingfromqubops.solution_vectorimportSolutionVector_V2asSolutionVectorfromqubops.mixed_solution_vectorimportMixedSolutionVector_V2asMixedSolutionVectorfromdwave.samplersimportSteepestDescentSolverdefdefine_matrices():
"""function that creates the polynom matrices for the system."""# see documentation for more informationreturnmatrices# define the encoding for the first two varialbesnqbit=5step=0.05encoding1=PositiveQbitEncoding(nqbit=nqbit, step=step, offset=0, var_base_name='x')
sol_vec1=SolutionVector(2, encoding=encoding1)
# define the encoding for the alst two variables nqbit=4step=0.05encoding2=PositiveQbitEncoding(nqbit=nqbit, step=step, offset=0, var_base_name='x')
sol_vec2=SolutionVector(2, encoding=encoding2)
# define the solution vectorsol_vec=MixedSolutionVector([sol_vec1,sol_vec2])
# instantiat the QUBOPS solveroptions= {'num_reads':10000, 'sampler':SteepestDescentSolver()}
qubo=QUBOPS_MIXED(sol_vec, options)
sol=qubo.solve(define_matrices(), strength=1E5)If you want to contribute to the development of qubops, have a look at the contribution guidelines.
This package was created with Cookiecutter and the NLeSC/python-template.
