eqc-models 0.14.4__tar.gz → 0.14.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eqc_models-0.14.4 → eqc_models-0.14.5}/PKG-INFO +1 -1
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/rcshortestpath.py +1 -1
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/shortestpath.py +6 -4
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models.egg-info/PKG-INFO +1 -1
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/test_shortestpath.py +29 -14
- {eqc_models-0.14.4 → eqc_models-0.14.5}/.gitignore +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/.gitlab-ci.yml +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/LICENSE.txt +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/MANIFEST.in +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/README.md +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/compile_extensions.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/Makefile +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/basic.css +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/css/badge_only.css +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/css/theme.css +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/custom.css +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/file.png +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/minus.png +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/plus.png +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/pygments.css +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/build/html/_static/white_logo.png +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/make.bat +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/_static/custom.css +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/_static/white_logo.png +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/conf.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/dependencies.rst +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/eqc_models.rst +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/index.rst +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/modules.rst +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/docs/source/usage.rst +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/algorithms/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/algorithms/base.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/algorithms/penaltymultiplier.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/allocation/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/allocation/allocation.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/allocation/portbase.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/allocation/portmomentum.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/assignment/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/assignment/qap.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/assignment/resource.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/assignment/setpartition.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/base.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/binaries.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/constraints.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/operators.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/polyeval.pyx +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/polynomial.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/quadratic.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/base/results.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/combinatorics/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/combinatorics/setcover.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/combinatorics/setpartition.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/decoding.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/base.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/hypergraph.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/maxcut.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/maxkcut.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/graph/partition.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/classifierbase.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/classifierqboost.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/classifierqsvm.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/clusteringbase.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/cvqboost_hamiltonian.pyx +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/cvqboost_hamiltonian_c_func.c +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/cvqboost_hamiltonian_c_func.h +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/decomposition.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/forecast.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/forecastbase.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/regressor.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/regressorbase.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/ml/reservoir.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/process/base.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/process/mpc.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/sequence/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/sequence/tsp.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/solvers/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/solvers/eqcdirect.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/solvers/mip.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/solvers/qciclient.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/solvers/responselog.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/utilities/__init__.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/utilities/fileio.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/utilities/general.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/utilities/polynomial.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models/utilities/qplib.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models.egg-info/SOURCES.txt +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models.egg-info/dependency_links.txt +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models.egg-info/requires.txt +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/eqc_models.egg-info/top_level.txt +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/pyproject.toml +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/binary_job_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/binary_w_continuous_solver_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/c6h6_graph_clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/continuous_job_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/convert_to_json_problem.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/crew_assignment_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/graph_clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/graph_partitioning.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/hamiltonian_to_polynomial.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/hypergraph.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/integer_job_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/karate_graph_clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/lin_reg_dirac3.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/mackey_glass_cell_production_series.csv +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/mip_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/pca_iris_dirac3.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/port_opt_dirac3.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qboost_iris_dirac3.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qboost_iris_dirac3_weak_cls.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qplib_benchmark_config.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qplib_reader.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qplib_runner.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qsvm_dual_iris_dirac3.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/qsvm_iris_dirac3.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/reservoir_forecast.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/results_example.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/rundoctests.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/scripts/utils.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/setup.cfg +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/doctest_base.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testallocationmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testconstraint.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testcvqboost.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testeqcdirectsolver.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testgraphpartitionmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testhypergraphmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testmaxcutmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testpolynomialmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testqapmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testqciclientsolver.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testquadraticmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testsetcovermodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testsetpartitionmodel.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testshortestpath.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test/testtsp.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/README.txt +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/run_tests.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/c6h6_graph_clustering/c6h6_graph_clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/clustering/clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/clustering/data/X.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/cvqboost_iris.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/data/X_test.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/data/X_train.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/data/y_test.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/data/y_train.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/karate_graph_clustering/karate_graph_clustering.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/pca_iris/pca_iris.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1MJC/data/C_1MJC.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1MJC/data/J_1MJC.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1MJC/protein_design_1MJC.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1NXB/data/C_1NXB.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1NXB/data/J_1NXB.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1NXB/protein_design_1NXB.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1POH/data/C_1POH.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1POH/data/J_1POH.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1POH/protein_design_1POH.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/X_test.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/X_train.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/y_test.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/y_train.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/qsvm_dual_iris.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/X_test.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/X_train.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/y_test.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/y_train.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/qsvm_primal_iris.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_100/data/C_8000000_100.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_100/data/J_8000000_100.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_100/synthetic_cls_100.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_300/data/C_8000000_300.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_300/data/J_8000000_300.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_300/synthetic_cls_300.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_500/data/C_8000000_500.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_500/data/J_8000000_500.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_500/synthetic_cls_500.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_700/data/C_8000000_700.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_700/data/J_8000000_700.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_700/synthetic_cls_700.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_900/data/C_8000000_900.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_900/data/J_8000000_900.npy +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_900/synthetic_cls_900.py +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_suite_config.json +0 -0
- {eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eqc-models
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.5
|
|
4
4
|
Summary: Optimization and ML modeling package targeting EQC devices
|
|
5
5
|
Author-email: "Quantum Computing Inc." <support@quantumcomputinginc.com>
|
|
6
6
|
Project-URL: Homepage, https://quantumcomputinginc.com
|
|
@@ -24,7 +24,7 @@ class RCShortestPathModel(ShortestPathModel):
|
|
|
24
24
|
# determine shortest path by weight
|
|
25
25
|
nx_path = nx.shortest_path(G, s, t)
|
|
26
26
|
path_length = len(nx_path)
|
|
27
|
-
self.resource_mult = resource_mult =
|
|
27
|
+
self.resource_mult = resource_mult = 1 / T
|
|
28
28
|
super(RCShortestPathModel, self).__init__(G, s, t)
|
|
29
29
|
upper_bound = np.ones(len(self.variables))
|
|
30
30
|
upper_bound[-1] = np.ceil(resource_mult * T)
|
|
@@ -91,7 +91,7 @@ class ShortestPathModel(EdgeMixin, ConstrainedQuadraticModel):
|
|
|
91
91
|
(i, j) = self.variables[l]
|
|
92
92
|
if i == j:
|
|
93
93
|
# self loops are not allowed
|
|
94
|
-
raise ValueError("Self loops are not allowed in
|
|
94
|
+
raise ValueError(f"Self loops are not allowed in {self.__class__.__name__}")
|
|
95
95
|
# # ignore these edges because we can't go back to s or leave t
|
|
96
96
|
elif j == self.s:
|
|
97
97
|
continue
|
|
@@ -125,10 +125,12 @@ class ShortestPathModel(EdgeMixin, ConstrainedQuadraticModel):
|
|
|
125
125
|
J = np.zeros((n, n))
|
|
126
126
|
return np.array(_obj), J
|
|
127
127
|
|
|
128
|
-
def decode(self, solution : np.ndarray) -> Dict:
|
|
128
|
+
def decode(self, solution : np.ndarray, weight="weight") -> Dict:
|
|
129
129
|
"""
|
|
130
130
|
Convert a solution to this model into a path, which is
|
|
131
|
-
a
|
|
131
|
+
a list as returned from nx.shortest_path with the pair option.
|
|
132
|
+
Specify the :code:`weight` kwarg to choose a metric for the final
|
|
133
|
+
evaluation.
|
|
132
134
|
|
|
133
135
|
"""
|
|
134
136
|
variables = self.variables[:len(self.G.edges)]
|
|
@@ -152,7 +154,7 @@ class ShortestPathModel(EdgeMixin, ConstrainedQuadraticModel):
|
|
|
152
154
|
self.alt_g = G
|
|
153
155
|
path = {}
|
|
154
156
|
try:
|
|
155
|
-
nx_path = nx.shortest_path(G, self.s, self.t)
|
|
157
|
+
nx_path = nx.shortest_path(G, self.s, self.t, weight=weight)
|
|
156
158
|
lower_thresh = thresh
|
|
157
159
|
got_path = nx_path
|
|
158
160
|
log.debug("Got path size %d", len(got_path))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eqc-models
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.5
|
|
4
4
|
Summary: Optimization and ML modeling package targeting EQC devices
|
|
5
5
|
Author-email: "Quantum Computing Inc." <support@quantumcomputinginc.com>
|
|
6
6
|
Project-URL: Homepage, https://quantumcomputinginc.com
|
|
@@ -4,10 +4,11 @@ import numpy as np
|
|
|
4
4
|
import networkx as nx
|
|
5
5
|
from eqc_models.graph.shortestpath import ShortestPathModel
|
|
6
6
|
from eqc_models.graph.rcshortestpath import RCShortestPathModel
|
|
7
|
-
from eqc_models.solvers import
|
|
8
|
-
from eqc_models.solvers.
|
|
7
|
+
from eqc_models.solvers import Dirac3MIPDirectSolver, Dirac3MIPCloudSolver
|
|
8
|
+
from eqc_models.solvers.mip import MIPMixin
|
|
9
9
|
from eqc_models.base.results import SolutionResults
|
|
10
|
-
logging.basicConfig(level=logging.
|
|
10
|
+
logging.basicConfig(level=logging.INFO)
|
|
11
|
+
np.set_printoptions(linewidth=180)
|
|
11
12
|
G = nx.DiGraph()
|
|
12
13
|
G.add_node("s")
|
|
13
14
|
G.add_node("t")
|
|
@@ -25,12 +26,15 @@ model.penalty_multiplier = 95
|
|
|
25
26
|
# model.is_discrete = [True for x in model.variables]
|
|
26
27
|
# model.is_discrete[-1] = False
|
|
27
28
|
print("Is Discrete:", model.is_discrete)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
lhs, rhs = model.constraints
|
|
30
|
+
print("SP CONSTRAINTS")
|
|
31
|
+
print(np.hstack([lhs, rhs.reshape((lhs.shape[0], 1))]))
|
|
31
32
|
# put a time limit of 20 on the path
|
|
32
33
|
rcmodel = RCShortestPathModel(G, "s", "t", 20)
|
|
33
|
-
rcmodel.penalty_multiplier =
|
|
34
|
+
rcmodel.penalty_multiplier = 200
|
|
35
|
+
lhs, rhs = rcmodel.constraints
|
|
36
|
+
print("RCSP CONSTRAINTS")
|
|
37
|
+
print(np.hstack([lhs, rhs.reshape((lhs.shape[0], 1))]))
|
|
34
38
|
# rcmodel.upper_bound = np.array([1 for x in model.variables])
|
|
35
39
|
# rcmodel.upper_bound[-1] = 10
|
|
36
40
|
# rcmodel.machine_slacks = 1
|
|
@@ -40,26 +44,37 @@ rcsum = len(rcmodel.G.edges) + int(rcmodel.upper_bound[-1])
|
|
|
40
44
|
if os.environ.get("EQC_DIRECT", "NO")=="YES":
|
|
41
45
|
ip_addr = os.environ.get("DEVICE_IP_ADDR", "172.18.41.171")
|
|
42
46
|
port = os.environ.get("DEVICE_PORT", "50051")
|
|
43
|
-
solver =
|
|
47
|
+
solver = Dirac3MIPDirectSolver()
|
|
44
48
|
solver.connect(ip_addr=ip_addr, port=port)
|
|
45
|
-
results = solver.solve(model, sum_constraint=spsum, num_samples=5, relaxation_schedule=
|
|
46
|
-
rcresults = solver.solve(rcmodel, sum_constraint=rcsum, num_samples=5, relaxation_schedule=
|
|
49
|
+
results = solver.solve(model, sum_constraint=spsum, num_samples=5, relaxation_schedule=2, mean_photon_number=0.006)
|
|
50
|
+
rcresults = solver.solve(rcmodel, sum_constraint=rcsum, num_samples=5, relaxation_schedule=2, mean_photon_number=0.006)
|
|
47
51
|
else:
|
|
48
|
-
solver =
|
|
49
|
-
results = solver.solve(model, sum_constraint=spsum, num_samples=5, relaxation_schedule=
|
|
52
|
+
solver = Dirac3MIPCloudSolver()
|
|
53
|
+
results = solver.solve(model, sum_constraint=spsum, num_samples=5, relaxation_schedule=2, mean_photon_number=0.006)
|
|
50
54
|
solutions = results.solutions
|
|
51
|
-
rcresults = solver.solve(rcmodel, sum_constraint=rcsum, num_samples=5, relaxation_schedule=
|
|
55
|
+
rcresults = solver.solve(rcmodel, sum_constraint=rcsum, num_samples=5, relaxation_schedule=2, mean_photon_number=0.006)
|
|
52
56
|
rcsolutions = rcresults.solutions
|
|
53
57
|
|
|
54
58
|
print("***** CHECKING ShortestPath ****")
|
|
55
59
|
print(model.variables)
|
|
56
60
|
for solution in solutions:
|
|
57
61
|
print(solution)
|
|
58
|
-
|
|
62
|
+
for solution in solutions:
|
|
63
|
+
try:
|
|
64
|
+
path = model.decode(solution)
|
|
65
|
+
break
|
|
66
|
+
except RuntimeError as err:
|
|
67
|
+
path = None
|
|
59
68
|
print(path)
|
|
60
69
|
print("***** CHECKING RCShortestPath ****")
|
|
61
70
|
print(rcmodel.variables)
|
|
62
71
|
for solution in rcsolutions:
|
|
63
72
|
print(solution)
|
|
73
|
+
for solution in rcsolutions:
|
|
74
|
+
try:
|
|
75
|
+
path = rcmodel.decode(solution, weight="resource")
|
|
76
|
+
break
|
|
77
|
+
except RuntimeError as err:
|
|
78
|
+
path = None
|
|
64
79
|
rcpath = rcmodel.decode(rcsolutions[0])
|
|
65
80
|
print(rcpath)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/cvqboost_iris.py
RENAMED
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/data/X_train.npy
RENAMED
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/cvqboost_iris/data/y_train.npy
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1MJC/data/C_1MJC.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1MJC/data/J_1MJC.npy
RENAMED
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1NXB/data/C_1NXB.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1NXB/data/J_1NXB.npy
RENAMED
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1POH/data/C_1POH.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/protein_design_1POH/data/J_1POH.npy
RENAMED
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/X_test.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/X_train.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/y_test.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/data/y_train.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_dual_iris/qsvm_dual_iris.py
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/X_test.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/X_train.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/y_test.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/data/y_train.npy
RENAMED
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/qsvm_primal_iris/qsvm_primal_iris.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_100/synthetic_cls_100.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_300/synthetic_cls_300.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_500/synthetic_cls_500.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_700/synthetic_cls_700.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eqc_models-0.14.4 → eqc_models-0.14.5}/test_suite/test_cases/synthetic_cls_900/synthetic_cls_900.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|