Skip to content
This repository was archived by the owner on Nov 29, 2024. It is now read-only.

Refactor #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
run: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install .[dev,publishing]
- name: Run unit tests
run: pytest -v
- name: Verify that we can build the package
run: python3 setup.py sdist bdist_wheel

Expand Down
106 changes: 0 additions & 106 deletions example/pennylane/reupload.ipynb

This file was deleted.

Binary file removed example/pennylane/train_features.npy
Binary file not shown.
Binary file removed example/pennylane/train_labels.npy
Binary file not shown.
Binary file removed example/pennylane/valid_features.npy
Binary file not shown.
Binary file removed example/pennylane/valid_labels.npy
Binary file not shown.
147 changes: 0 additions & 147 deletions example/qiskit/vqees/vqap.ipynb

This file was deleted.

230 changes: 0 additions & 230 deletions example/qiskit/vqees/vqees.ipynb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
"metadata": {},
"outputs": [],
"source": [
"from qalcore.dwave.qubols.qubols import QUBOLS\n",
"from qalcore.dwave.qubols.encodings import RealQbitEncoding, RealUnitQbitEncoding, EfficientEncoding\n",
"from qalcore.qubols import QUBOLS\n",
"from qalcore.qubols import RealQbitEncoding, RealUnitQbitEncoding, EfficientEncoding\n",
"options = {'num_reads':100, 'num_qbits':21, 'encoding':EfficientEncoding}\n",
"qubols = QUBOLS(options)\n",
"sol_num = qubols.solve(A, b)"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"from qalcore.qiskit.vqls.vqls import VQLS\n",
"from qalcore.vqls import VQLS\n",
"from qiskit.circuit.library.n_local.real_amplitudes import RealAmplitudes\n",
"from qiskit.algorithms.optimizers import COBYLA\n",
"from qiskit.quantum_info import Statevector\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from qalcore.qiskit.vqls import VQLS
from qalcore.vqls import VQLS
from qiskit.circuit.library.n_local.real_amplitudes import RealAmplitudes
from qiskit.algorithms.optimizers import COBYLA, ADAM
import numpy as np
Expand All @@ -7,8 +7,13 @@
from qiskit.quantum_info import Statevector

# from qiskit.primitives import Estimator, Sampler, BackendEstimator
from qiskit_ibm_runtime import QiskitRuntimeService, Estimator, Sampler, Session, Options

from qiskit_ibm_runtime import (
QiskitRuntimeService,
Estimator,
Sampler,
Session,
Options,
)


# define the problem
Expand All @@ -20,8 +25,7 @@
# define ansatz
ansatz = RealAmplitudes(2, entanglement="full", reps=3, insert_barriers=False)

opts = {"use_overlap_test": False,
"use_local_cost_function": False}
opts = {"use_overlap_test": False, "use_local_cost_function": False}

# define the runtime
service = QiskitRuntimeService()
Expand All @@ -36,22 +40,17 @@
estimator = Estimator(session=session, options=options)

# Sampler = Sampler(session=session, options=options)
vqls = VQLS(
estimator,
ansatz,
ADAM(maxiter=5, disp=True),
options=opts
)

vqls = VQLS(estimator, ansatz, ADAM(maxiter=5, disp=True), options=opts)

res = vqls.solve(A, b)


classical_solution = np.linalg.solve(A,b)
classical_solution = np.linalg.solve(A, b)

ref_solution = classical_solution/ np.linalg.norm(classical_solution)
ref_solution = classical_solution / np.linalg.norm(classical_solution)
vqls_solution = np.real(Statevector(res.state).data)


plt.scatter(ref_solution, vqls_solution)
plt.plot([-1, 1], [-1, 1], "--")
plt.show()
plt.show()
Empty file removed qalcore/dwave/__init__.py
Empty file.
Empty file removed qalcore/dwave/qubols/__init__.py
Empty file.
110 changes: 0 additions & 110 deletions qalcore/dwave/qubols/embedded_qubols.py

This file was deleted.

Loading