Skip to content

Commit

Permalink
new version, quantum annealer example
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Mar 22, 2024
1 parent 6a5d264 commit 68ac3dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
25 changes: 21 additions & 4 deletions docs/source/bqm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,32 @@
"metadata": {},
"source": [
"### Running on DWave annealer\n",
"\n"
"\n",
"If we have a valid DWave account, we can run our problem on a real quantum annealer as follow:"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'a': 5, 'b': 3}\n"
]
}
],
"source": [
"from dwave.system import DWaveSampler, EmbeddingComposite\n",
"\n",
"sampler = EmbeddingComposite(DWaveSampler()) \n",
"sampleset = sampler.sample(bqm, num_reads=10)\n",
"decoded_samples = decode_samples(test_factor, sampleset)\n",
"best_sample = min(decoded_samples, key=lambda x: x.energy)\n",
"print(best_sample.sample)"
]
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion qlasskit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
# isort:skip_file

__version__ = "0.1.15"
__version__ = "0.1.16"

from .qcircuit import QCircuit, SupportedFrameworks, SupportedFramework # noqa: F401
from .qlassfun import QlassF, qlassf, qlassfa # noqa: F401
Expand Down

0 comments on commit 68ac3dd

Please sign in to comment.