Skip to content

Commit 97513d3

Browse files
Add M1 image for MacOS for tests (#779)
* Add M1 image for MacOS for tests * Switch to 3.10 update failing tests * I need ``'3.10'` not `3.10` which gets interpreted as `3.1` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 60f2c2e commit 97513d3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/main.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ jobs:
122122
python-version: 3.8
123123
- os: windows-latest
124124
python-version: 3.12
125+
# macos-14 is an Arm64 image
126+
- os: macos-14
127+
python-version: '3.10'
128+
- os: macos-14
129+
python-version: 3.12
125130
steps:
126131
- uses: actions/checkout@v4
127132
- uses: actions/setup-python@v5
@@ -301,12 +306,20 @@ jobs:
301306
with:
302307
name: windows-latest-3.12
303308
path: /tmp/w312
309+
- uses: actions/download-artifact@v4
310+
with:
311+
name: macos-14-3.10
312+
path: /tmp/a310
313+
- uses: actions/download-artifact@v4
314+
with:
315+
name: macos-14-3.12
316+
path: /tmp/a312
304317
- name: Install Dependencies
305318
run: pip install -U coverage coveralls diff-cover
306319
shell: bash
307320
- name: Combined Deprecation Messages
308321
run: |
309-
sort -f -u /tmp/u38/ml.dep /tmp/u39/ml.dep /tmp/u310/ml.dep /tmp/u311/ml.dep /tmp/u312/ml.dep /tmp/m38/ml.dep /tmp/m312/ml.dep /tmp/w38/ml.dep /tmp/w312/ml.dep || true
322+
sort -f -u /tmp/u38/ml.dep /tmp/u39/ml.dep /tmp/u310/ml.dep /tmp/u311/ml.dep /tmp/u312/ml.dep /tmp/m38/ml.dep /tmp/m312/ml.dep /tmp/w38/ml.dep /tmp/w312/ml.dep /tmp/a310/ml.dep /tmp/a312/ml.dep || true
310323
shell: bash
311324
- name: Coverage combine
312325
run: coverage3 combine /tmp/u38/ml.dat

test/algorithms/regressors/test_qsvr.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This code is part of a Qiskit project.
22
#
3-
# (C) Copyright IBM 2021, 2023.
3+
# (C) Copyright IBM 2021, 2024.
44
#
55
# This code is licensed under the Apache License, Version 2.0. You may
66
# obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -51,7 +51,7 @@ def setUp(self):
5151

5252
def test_qsvr(self):
5353
"""Test QSVR"""
54-
qkernel = FidelityQuantumKernel(feature_map=self.feature_map)
54+
qkernel = FidelityQuantumKernel(feature_map=self.feature_map, enforce_psd=False)
5555

5656
qsvr = QSVR(quantum_kernel=qkernel)
5757
qsvr.fit(self.sample_train, self.label_train)
@@ -61,7 +61,7 @@ def test_qsvr(self):
6161

6262
def test_change_kernel(self):
6363
"""Test QSVR with QuantumKernel later"""
64-
qkernel = FidelityQuantumKernel(feature_map=self.feature_map)
64+
qkernel = FidelityQuantumKernel(feature_map=self.feature_map, enforce_psd=False)
6565

6666
qsvr = QSVR()
6767
qsvr.quantum_kernel = qkernel

0 commit comments

Comments
 (0)