node-red-quantum / node-red-contrib-quantum

Quantum computing functionality for Node-RED
https://node-red-quantum.github.io/
Apache License 2.0
16 stars 2 forks source link

Chon/fc portfolio optimisation #98

Closed XxWirusonxX closed 3 years ago

XxWirusonxX commented 3 years ago

Purpose

https://qiskit.org/documentation/finance/tutorials/01_portfolio_optimization.html

image

Portfolio Optimization for Finanace Computing with user params: Portfolio Optimisation: Default: numPy Minimum Eigensolver (NME) (shown as none but run NME if user didnt choose any optimization method) Options: numPy Minimum Eigensolver (NME) | Variational Quantum Eigensolver (VQE) | Quantum Approximate Optimization Algorithm (QAOA)

seeds: Default: 123 Options: numbers greater than 0, used as number of times for simulations.

assets(qubits): Default: 4 Options: minimum is 1, havent tested the maximum yet, this is the number of qubits.

Start Date: Default: none Options: Date before End Date

End Date: Default: none Options: Date After Start Date

Changes

Added the Portfolio Optimization Node

New Requirements

Require pip install the following: qiskit-finance qiskit-optimization

XxWirusonxX commented 3 years ago

Help needed, my dropdown menu doesnt work it kept returning undefined or none. meanwhile, i will work on add more user params. ive spent too much time on fixing the dropdown...

XxWirusonxX commented 3 years ago

dropdown now works.

louislefevre commented 3 years ago

Could you provide some example screenshots of how this node can be used, please?

louislefevre commented 3 years ago

Lastly, do qiskit-finance and qiskit-optimization not come with Qiskit by default? If not I'll add them to the setup script (though I would like to merge PR #100 first due to some changes I made to the script.

XxWirusonxX commented 3 years ago

Lastly, do qiskit-finance and qiskit-optimization not come with Qiskit by default? If not I'll add them to the setup script (though I would like to merge PR #100 first due to some changes I made to the script.

Finance and Optimization are deprecated from Qiskit and moved to 2 separate packages, super annoying :/

will work on changes asap

louislefevre commented 3 years ago

@XxWirusonxX Could you provide some example screenshots of how this node can be used, please?

XxWirusonxX commented 3 years ago

@XxWirusonxX Could you provide some example screenshots of how this node can be used, please?

updated the Description of PR with example

louislefevre commented 3 years ago

I tried adding the qiskit-finance and qiskit-optimization packages to the setup script (526aca6842671139805f7fd2768350f625d480c5), but for some reason that causes random tests to fail on the CI. I have literally no idea why, best guess is that maybe there is some sort of conflict occurring between the packages?

louislefevre commented 3 years ago

I tried adding the qiskit-finance and qiskit-optimization packages to the setup script (526aca6), but for some reason that causes random tests to fail on the CI. I have literally no idea why, best guess is that maybe there is some sort of conflict occurring between the packages?

I think this should be fixed now that PR #110 is merged, but for some reason the CI wasn't triggered on push. Probably a problem with GitHub Actions being down temporarily or something, so will have to test if it's fixed on next push.

I think the issue was due to the pyvenv.sh script incorrectly thinking Qiskit was installed when it wasn't. Below is the installation output:

Creating virtual environment at /home/runner/work/node-red-contrib-quantum/node-red-contrib-quantum/venv...
Successfully created virtual environment
Installing qiskit-optimization...
Successfully installed qiskit-optimization
Installing matplotlib...
Successfully installed matplotlib
qiskit is installed  <-- This shouldn't have happened
Installing qiskit-finance...
Successfully installed qiskit-finance
Installing pylatexenc...
Successfully installed pylatexenc

Once qiskit-optimization was installed, it caused the check for seeing if qiskit is installed to be a false positive. PR #110 improved the robustness of this check, so the issue should be avoided now.

Theo-Reignier commented 3 years ago

Can we use this PR to change 'Shors' nodes icon? For now, it is the same as 'Grovers' icon.

I would suggest one of these two:

Screenshot 2021-09-05 at 23 40 43 Screenshot 2021-09-05 at 23 42 52

Theo-Reignier commented 3 years ago
Screenshot 2021-09-06 at 11 30 10