Skip to content

Commit 359eacb

Browse files
committed
updated backend tests
1 parent da454ed commit 359eacb

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

qhdopt/qhd.py

-20
Original file line numberDiff line numberDiff line change
@@ -214,26 +214,6 @@ def qutip_setup(
214214
self.shots = shots
215215
self.post_processing_method = post_processing_method
216216

217-
def baseline_setup(
218-
self,
219-
shots: int = 100,
220-
post_processing_method: str = "TNC",
221-
):
222-
"""
223-
Sets up the baseline configuration for classical optimization comparison.
224-
225-
Args:
226-
shots: The number of solution samples to generate.
227-
post_processing_method: The classical optimization algorithm to use.
228-
"""
229-
func, syms = self.generate_affined_func()
230-
self.qhd_base = QHD_Base(func, syms, self.info)
231-
self.qhd_base.baseline_setup(
232-
shots=shots
233-
)
234-
self.shots = shots
235-
self.post_processing_method = post_processing_method
236-
237217
def affine_transformation(self, x: np.ndarray) -> np.ndarray:
238218
"""
239219
Applies an affine transformation to the input array.

tests/test_backend.py

+7
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,12 @@ def test_backend_performance():
2020
ionq_backend = model.compile_only()
2121
assert len(ionq_backend.qs.evos) == 5
2222

23+
model.dwave_setup(resolution=2,
24+
api_key='dwave_api_key')
25+
dwave_compile = model.compile_only()
26+
assert dwave_compile.chain_strength == 0.04
27+
assert dwave_compile.penalty_coefficient == 0.035
28+
dwave_compile.print_compilation_info()
29+
2330

2431

0 commit comments

Comments
 (0)