Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantum Kernel #2

Merged
merged 39 commits into from
Mar 21, 2021
Merged

Quantum Kernel #2

merged 39 commits into from
Mar 21, 2021

Conversation

attp
Copy link
Contributor

@attp attp commented Mar 3, 2021

Class (quantum_kernel.py) that calculates a quantum kernel for use in scikit-learn machine learning algorithms for classification (qsvc.py) and regression (qsvr.py) algorithms.

To do:

  • determine interface for qsvc and qsvr
  • write test cases for qsvc and qsvr
  • update tutorial

qiskit_machine_learning/algorithms/classifiers/qsvc.py Outdated Show resolved Hide resolved
qiskit_machine_learning/algorithms/regressors/qsvr.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
qiskit_machine_learning/kernels/quantum_kernel.py Outdated Show resolved Hide resolved
@attp
Copy link
Contributor Author

attp commented Mar 15, 2021

@stefan-woerner previously you mentioned that the QSVR and QSVC classes should perhaps directly take a QuantumKernel in their constructor, rather than a feature_map / quantum_instance. we should decide on this. I don't have a strong opinion about this either way.

@stefan-woerner
Copy link
Contributor

@attp let's leave as is with feature map and quantum instance.

@attp
Copy link
Contributor Author

attp commented Mar 18, 2021

@attp let's leave as is with feature map and quantum instance.

Now that I'm adding documentation and tests, it makes more sense to initialise QSVC and QSVR with a QuantumKernel rather than a feature_map and quantum_instance.

Copy link
Contributor

@stefan-woerner stefan-woerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@woodsp-ibm woodsp-ibm merged commit d41b975 into qiskit-community:master Mar 21, 2021
gentinettagian pushed a commit to gentinettagian/qiskit-machine-learning that referenced this pull request Dec 14, 2021
* Added quantum_kernel, qsvc and qsvr classes.

* Add quantum kernel tests and tutorial

* add QuantumKernel to html docs

* Added default feature map.

* Add QSVR

* Changed default feature map to PauliFeatureMap, with no features, then check for no features in evaluaute
Added new test case for no feature map provided

* Changed QSVC to take a quantum kernl and added tests

* Made ZZFeatureMap with 2 qubits default and modified evaluate method accordingly. Changed tests to match.

* Edited QSVC and QSVR classes to take QuantumKernel.

* Changed enforce_psd default to true. Added more details to init docstring.

* Added tests for sending arguments to SVC constructor.

* Updated qsvr and made test_qsvr
Fixed comments in qsvc and test_qsvc

* Renamed quantum kernel tutorial and added example using qsvc

* Modifed test_qkernel since default for enforce_psd is now True, not False.

Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants