Repository: qiskit-community/qiskit-machine-learning (language: python)

Issue:
Fix unit test that is breaking CI
<!--
⚠️ If you do not respect this template, your pull request will be closed.
⚠️ Your pull request title should be short detailed and understandable for all.
⚠️ Also, please add it in the CHANGELOG file under Unreleased section.
⚠️ If your pull request fixes an open issue, please link to the issue.

✅ I have added the tests to cover my changes.
✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.
-->

### Summary

CI has been failing nightly builds for a while. The error is

```
File "/Users/runner/work/qiskit-machine-learning/qiskit-machine-learning/test/neural_networks/test_circuit_qnn.py", line 27, in <module>
    from qiskit.compiler.transpiler import PassManagerConfig, level_1_pass_manager, level_2_pass_manager
ImportError: cannot import name 'PassManagerConfig' from 'qiskit.compiler.transpiler' 
```

The transpiler.py file changed in the last release of Qiskit and no  longer imports the above. The test should not have been importing them via compiler.transpiler.py (which is what it was doing) rather it should have been importing them the same way that file imported them. This changes the test case to do just that so CI should now run again (tests pass locally for me now)

I did not notice the tutorials here were failing too. I added the same workaround as we had in the other apps which gets the python3 kernel installed.

### Details and comments



Fix unit test that is breaking CI
<!--
⚠️ If you do not respect this template, your pull request will be closed.
⚠️ Your pull request title should be short detailed and understandable for all.
⚠️ Also, please add it in the CHANGELOG file under Unreleased section.
⚠️ If your pull request fixes an open issue, please link to the issue.

✅ I have added the tests to cover my changes.
✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.
-->

### Summary

CI has been failing nightly builds for a while. The error is

```
File "/Users/runner/work/qiskit-machine-learning/qiskit-machine-learning/test/neural_networks/test_circuit_qnn.py", line 27, in <module>
    from qiskit.compiler.transpiler import PassManagerConfig, level_1_pass_manager, level_2_pass_manager
ImportError: cannot import name 'PassManagerConfig' from 'qiskit.compiler.transpiler' 
```

The transpiler.py file changed in the last release of Qiskit and no  longer imports the above. The test should not have been importing them via compiler.transpiler.py (which is what it was doing) rather it should have been importing them the same way that file imported them. This changes the test case to do just that so CI should now run again (tests pass locally for me now)

I did not notice the tutorials here were failing too. I added the same workaround as we had in the other apps which gets the python3 kernel installed.

### Details and comments





Discussion / hints:
## Pull Request Test Coverage Report for [Build 5859929668](https://coveralls.io/builds/61979428)

* **0** of **0**   changed or added relevant lines in **0** files are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage remained the same at **92.915%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/61979428/badge)](https://coveralls.io/builds/61979428) |
| :-- | --: |
| Change from base [Build 5331720900](https://coveralls.io/builds/60864097): |  0.0% |
| Covered Lines: | 2649 |
| Relevant Lines: | 2851 |

---
##### 💛  - [Coveralls](https://coveralls.io)

## Pull Request Test Coverage Report for [Build 5859929668](https://coveralls.io/builds/61979428)

* **0** of **0**   changed or added relevant lines in **0** files are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage remained the same at **92.915%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/61979428/badge)](https://coveralls.io/builds/61979428) |
| :-- | --: |
| Change from base [Build 5331720900](https://coveralls.io/builds/60864097): |  0.0% |
| Covered Lines: | 2649 |
| Relevant Lines: | 2851 |

---
##### 💛  - [Coveralls](https://coveralls.io)


Fix patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c917971dc..4f24149f3 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -203,6 +203,7 @@ jobs:
       - uses: ./.github/actions/install-machine-learning
       - name: Install Dependencies
         run: |
+          pip install jupyter
           pip install torchvision
           sudo apt-get install -y pandoc graphviz
         shell: bash


Test patch:
diff --git a/test/neural_networks/test_circuit_qnn.py b/test/neural_networks/test_circuit_qnn.py
index 258da51b9..e1b1cb657 100644
--- a/test/neural_networks/test_circuit_qnn.py
+++ b/test/neural_networks/test_circuit_qnn.py
@@ -1,6 +1,6 @@
 # This code is part of Qiskit.
 #
-# (C) Copyright IBM 2018, 2022.
+# (C) Copyright IBM 2018, 2023.
 #
 # This code is licensed under the Apache License, Version 2.0. You may
 # obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -24,8 +24,9 @@
 from qiskit.circuit import QuantumCircuit, Parameter
 from qiskit.circuit.library import RealAmplitudes, ZZFeatureMap
 from qiskit.utils import QuantumInstance, algorithm_globals, optionals
-from qiskit.compiler.transpiler import PassManagerConfig, level_1_pass_manager, level_2_pass_manager
 from qiskit.providers.fake_provider import FakeToronto
+from qiskit.transpiler import PassManagerConfig
+from qiskit.transpiler.preset_passmanagers import level_1_pass_manager, level_2_pass_manager
 
 from qiskit_machine_learning import QiskitMachineLearningError
 from qiskit_machine_learning.neural_networks import CircuitQNN