Chicago quantum BLOG

  Chicago Quantum | US Advanced Computing Infrastructure, Inc.
  • Home
  • Team
  • Research
  • Buy Analysis
  • Market Questions & Data
  • Contact
  • Blog
  • Use Cases
  • Platforms
  • Quantum FAQs
  • Chicago Quantum | Corporate Finance 101
  • 1-hour working session
  • 1-day working session
  • 1-week strategy workshop
  • Analyze up to 3,250 stocks (quantum or classically)
  • 64 Stocks (Quantum & Classical)
  • 64 Stocks (Classical)
  • T-Shirts
  • Custom Algorithm Development
  • Platforms Detail
  • Use Case Detail
  • Market Data
  • Validated tickers
  • Portfolio.m

We ran & customized the IBM Qiskit portfolio optimization tutorial for 8 stocks (Part 2: Technical notes)

1/20/2021

0 Comments

 
Jeffrey Cohen, President, US Advanced Computing Infrastructure, Inc.  Jan 20, 2021
For more information: jeffrey@quantum-usaci.com or 847.780.4401 (office)

For those who follow Chicago Quantum, you know that we have focus on building a classical and quantum platform with a first use case of picking efficient stock portfolios.  That platform is based on custom, classical solvers to solve the 'stock pickers problem' and uses quantum annealing.  The proprietary algorithm runs as a quadratic, unconstrained, binary, optimization (QUBO) problem that we load into a matrix and solve in both classical and quantum hardware.

Yesterday we ran the IBM Q Quantum Experience tutorial for portfolio optimization on IBM-provided simulators, classical solvers, and the real quantum computer called 'melbourne' which has 15 qubits, of which 14 are listed in the documentation and 13 appear functional at time of the experiment. This is the first time we have run portfolio optimization on a quantum computer.  A few caveats before we get started and share what we learned:
  1. We are using the IBM default equation (a.t * COV * a) - ER, and looking for the minimum value
  2. We did not validate the randomized (we think) data, nor the classical results - assume ok.  Here is the Qiskit code for the Numpy Minimum Eigensolver.
  3. We ran 1,000 'shots' on the IBM Q quantum computer...but this means to run the job one at a time, 1,000 times.  Sorry IBM for filling the queue.  We meant to run it once, with 1,000 shots.  A day later it is still running, once every ~45 minutes.  Hitting cancel does not cancel the job.
  4. We don't know how the number of assets is related to the number of qubits at this point, nor how many assets we can run.
  5. IBM Code and Instructions found here.
  6. StackExchange for quantum computing found here (answered a question for us)
  7. Github device information for IBM Q 16 Melbourne found here.  (14 qubits listed)
Picture
The picture above is from the IBM description of 'melbourne' in Github in the link above.  Below we can see the frequency, in gigahertz, for the individual qubits in the 'melbourne' machine.  We notice that there are 15 qubits, but one appears down, and another operating at a very low frequency.  The connectivity between these qubits is about 2:1, and direction matters.  Not all qubits have 2 'friends' in two directions.  
Picture
Picture above is from the IBM Quantum Experience dashboard.  This would imply that we have 13 functioning qubits to run our 8-stock analysis.  It would also mean that the connectivity between 3, 8, and 12 with other qubit would be down, so long swaps (e.g., 8-9, 9-10, 10-11, 11-12, 12-13) would likely not function.
Picture
The picture above shows the actual error rates calculated for the qubits, and we can see the darker color for qubits 8 and 12, as highlighted above.  The average CNOT error rate is 3.3%, with a range of 1.2% to 7.7%.  As seen below, we have an average CNOT error rate of 3.3%, and an average readout error rate of 6.5%.  Also, the decoherence times are measured by T1 and T2 at 53 and 62 micro-seconds respectively.  So, we had better move fast and keep our logic chains short on this system at this time.
​
Picture

Since a stock picking problem (the way we code it) requires fully connected vertices, or cliques, we need extra steps (swaps) to connect qubits that are not hardware connected.  This makes our quantum logic map, or circuit, relatively long, at 406 steps (in some steps there are more than one operations).  This is followed by 8 read-out steps (as seen in the 3 pictures below).
​
Picture
Picture
Picture
This particular run, which took 46.4 minutes to run, gave us an answer that favored smaller portfolios than the optimal size of four.  The best portfolio is stocks 2,5,7 & 8, and that answer was chosen with 0.195% probability (out of 100%).  We downloaded the .CSV file (found here) and manually searched for it.  The highest probability, 4.004%, was for zero stocks, or keeping your money in riskfree assets.   
histogram_of_ibmq_8_stock_answers_-_melbourne.numbers
File Size: 176 kb
File Type: numbers
Download File

Picture
Our intuition for this is that after running 406 logical gates, or swaps of data, most of the qubits have a significant probability of losing their entanglement (or ability to keep an accurate value in memory before readout).  This would mean our answers would have a significant chance of a 'bit-flip' or even a return to a ground-state of zero (or no stock). 

If the gates were applied equally, we still have 406 / 14 = 29 operations per qubit.  This is a significant workload when the typical gate has an error probability that is significant (from 1% to 10%) for each logic and read step.

Our take-away is that this particular answer is likely too random to give us actionable intelligence.  We need to refine our models, logic, and approach to restructure the problem for gate-based computing.  If we think the best answer will somehow 'shine through' the randomizing errors, then we should run the problem many times.  However, at today's queue length and queue time, running about (31 to 57), and an average of ~45 minutes of queue-time per shot, and (7.0 to 7.5) seconds of run time, we would run out of time even if the first answer was the best one.
Picture
One way to get around the queue time is to use the 5-qubit machines which have smaller queues.  Here is a list of the machines we have access to in the IBM Q Quantum Experience.
The QV stands for quantum value, and is an indicator of workload throughput.  Higher is better.  It looks like there is a newer processor type, called the Canary r3.  Maybe we should have used 'ibmq_athens' or 'ibmq_santiago' before IBMQ_16_melbourne?

Picture
This is the second of two BLOG posts.  As stated in the first post, we placed our source code for this run in our public Github.  You may find this code here.  
Picture
We will continue to provide you updates as we make progress with gate-based computing.

If you would like to purchase a stock analysis using our quantum algorithm and our quantum and classical platform, please check out our offerings here.  To email the author: jeffrey@quantum-usaci.com.  To call the author: 847.780.4401.  

​Thank you for reading.  Comments and feedback welcome.

Select efficient stock portfolio(s) from up to 128 of your stocks (Chicago Quantum Net Score)

$150.00
You enter up to 128 stock tickers + 10 backup tickers. We run our analysis, select the best portfolio(s) based on our CQNS algorithm, and email you a .PDF report.

You may have other options and comment boxes to complete during checkout, and you may request report delivery in other ways.



Once you place your order, please email us your information:

 
  • Your name
  • Your email address(es)
  • Your phone (optional, in case we need to reach you)
  • Your US stock tickers (up to 128) and up to 10 backup tickers.
  • Any special requests


Please email these to jeffrey@quantum-usaci.com and research@quantum-usaci.com


Your payment confirmation comes from the payment processor.




What we do:


We run our analysis, select the best portfolio(s) based on our CQNS algorithm, and return you a .PDF report via email (or another way if you prefer). We return it within 24 hours...possibly much faster.


The report will list the stocks you provided, results of data validation, and the best portfolio(s) we find. If our solvers do not converge on one 'best' portfolio, we will provide you the top 3 portfolios they find. We provide you any insights from the run (e.g., was it easy to find a 'best' portfolio).


We wait until the trading day is over, but can use today's intraday price data if you ask.


If you provide non-US listed stocks, we will include if the data is available via Yahoo Finance.




What you should expect from the results:


This algorithm gives you the portfolio with the desired characteristics (lower risk & higher return) in the past year.


We view this as a buy and hold strategy for up to 25 days, but have seen the effects last as long as 35 days. We have also 'swing traded' these results to capture short-term volatility.


We have seen offsetting stocks in these portfolios where some rise while the others fall, but overall the portfolio rises. In a few cases, one 'high flyer' carries the portfolio. Why does this happen? If the BETA values selected are higher than market average, then the stocks may move more than the market. If the risk is lower for those stocks, and the BETA is higher, then we may see investors attracted to those stocks in the short-term.




The value proposition:


You can most likely re-create this logic and build the data analytics capability to do a similar exercise (e.g., using the Sharpe Ratio). However, it would take significant time to learn and master. Mistakes are hard to discover and the data can be tricky to download and validate. Also, this is computationally difficult. With our service, and expertise, we can help you achieve these results quickly and cost effectively.




Explanations:


Please see our webpage "Stock Market Links & FAQs" for details.




Disclosure


We think investors need to do their own due diligence on the companies and ensure they understand the risks associated with investing. Our model looks at the adjusted closing prices and the patterns between stocks held in that data.


Note: The algorithm and methods used are subject to frequent change and development. Do not rely on this service for your investment decisions, and do your due diligence. This is not investment advice. We are not investment advisors.




Thank you for your order and your business.
Shop

Select efficient stock portfolio(s) from US stock market exchanges (Chicago Quantum Net Score)

$750.00
You select up to four US stock exchanges for us to analyze all of their common stocks. You can choose from NYSE, NYSE American, NASDAQ Global and NASDAQ Global Select exchanges (about 3,500 common stocks before data validation). There are other options and comment boxes to complete (optionally) during checkout.


Once you place your order, please email us your information:

 
  • Your name
  • Your email address(es)
  • Your phone (optional, in case we need to reach you)
  • Any special requests


Please email these to jeffrey@quantum-usaci.com and research@quantum-usaci.com.


Your payment confirmation comes from the payment processor.




What we do:


We run our analysis by selecting the most efficient portfolio(s) based on our Chicago Quantum Net Score (CQNS), based on the prior 1-year of adjusted close prices of all the common stocks that pass data validation. We then return you a .PDF report via email (or another way if you prefer) and return it within 24 hours...possibly much faster.


The report will list the stocks that passed data validation and were analyzed, along with the most efficient portfolio(s) we found according to our Chicago Quantum Net Score. If our solvers do not converge on one 'best' portfolio, we will provide you the top 3 portfolios found. We provide you any additional insights from the run.


We also provide a short analysis of the skewness, kurtosis and variance of the stocks that passed data validation.


We wait to pull the data until the trading day is over, which ensures you have a clean set of price data. However, we can use today's intraday price data upon request.


If you provide non-US listed stocks, we will include if the data is available via Yahoo Finance.




What you should expect from the results:


This algorithm gives you the portfolio with the desired characteristics (lower risk & higher return) in the past year. We expect those patterns to continue into the near future.


We view this as a buy and hold strategy for up to 25 days, but have seen the effects last as long as 35 days. We have also 'swing traded' these results to capture short-term volatility.


We have seen offsetting stocks in these portfolios where some rise while the others fall. We call this 'zig and zag' in the portfolio. In the model runs that we have made (not for clients) and posted on Medium, we generally see an outperformance of the benchmarks (SPY and QQQ) over the first 25 - 35 trading days. In a few portfolios, one 'high flyer' carries the portfolio.


Why does this happen? If the BETA values selected are higher than market average, then the stocks may move more than the market. If the risk is lower for those stocks, and the BETA is higher, then we may see investors attracted to those stocks in the short-term.




The value proposition:


You may be able to re-create this logic and build the data analytics capability to do a similar exercise (e.g., using the Sharpe Ratio or by reading our academic paper pre-prints). However, it will take significant time and expertise to learn and master. Mistakes are hard to discover and the data can be tricky to download and validate. With our service, and expertise, we can help you achieve these results quickly and cost effectively. We also provide excellent customer support and are patient (and passionate) in explaining the results and implications.




Explanations:


Please see our webpage "Stock Market Links & FAQs" for details.




Disclosure


We think investors need to do their own due diligence on the companies and ensure they understand the risks associated with investing. Our model looks at the adjusted closing prices and the patterns between stocks held in that data.


Note: The algorithm and methods used are subject to frequent change and development. Do not rely on this service for your investment decisions. This is not investment advice. We are not investment advisors.




Thank you for your order and your business.
Shop

Consultation: Discussion of the Chicago Quantum Net Score (30 minutes)

$100.00

You and the President of US Advanced Computing Infrastructure, Inc. will have a discussion of the Chicago Quantum Net Score algorithm, methodology, and results of our work. Some clients with to arrange this for after their stock market analysis to better understand the results and discuss implications.


Discussion to be scheduled and conducted as soon as practical, and can be within 1 hour if necessary.


After payment, please text Jeffrey Cohen at +1.312.515.7333 or email him at jeffrey@quantum-usaci.com to schedule your consultation.

Shop

One week of custom portfolio algorithm development & coding (quantum & classical)

$7,500.00

One of our senior team members (President or Associate) will code your algorithm ideas into quantum and classical algorithms for one week.


One week is defined as a continuous 5 day period (e.g., Monday - Friday, or Saturday - Wednesday), with a 60 hour maximum (yes, 60 hours...because coding requires focus & time).


The code and documentation we develop is yours to keep, to use and to sell.


We apply our skills, experience, and knowledge of the D-Wave Systems quantum annealing computers as well as with coding and running classical solvers. We apply our domain expertise. We work with your team as requested. We can provide virtual training and mentorship while we code.


We have experience in working with classical solvers such as:

Monte Carlo

Genetic Algorithm

Simulated Annealer

Simulated Bifurcator

Particle Swarm Optimization

TABU MultiStart


We have experience working with the D-Wave Systems quantum annealing computers (Advantage 1.1 and 2000Q). One member of our current team has experience with gate-based computers (IBM Q).


We will leverage your expertise in coding these if/when we work together with your development or trading teams. We are happy to work with you in your facility (safely due to Covid 19), work on video, or work remotely against your specifications.


We work in Python in Jupyter Notebooks, and code our proprietary solvers into the notebooks, along with code to run the D-Wave Systems quantum annealing computers. You may want to software engineer that code afterwards so harden and speed up the models.


You receive and own the code and documentation that we built upon payment for the time you have purchased. If you pay in advance (as you can with this website), you can request the code and documentation at any time.


We act in a confidential manner for you.


Our expertise has been sharpened with our focus on one optimization problem: US common stock portfolio optimization. We believe this expertise can be used to help solve other optimization problems.

Shop
0 Comments



Leave a Reply.

    View my profile on LinkedIn

    Jeff Cohen

    Strategic IT Management Consultant with a strong interest in Quantum Computing.  Consulting for 29 years  and this looks as interesting as cloud computing was in 2010.

    Archives

    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    April 2020
    March 2020
    February 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019

    RSS Feed

Copyright 2021 US Advanced Computing Infrastructure, Inc.  
Chicago Quantum (SM) is a protected service mark, registration 113562, by the Secretary of State of Illinois.

Disclaimer: 
US Advanced Computing Infrastructure, Inc. does not provide personal investment or financial advice to individuals, or act as personal financial, legal, or institutional investment advisors, or individually advocate the purchase or sale of any security or investment or the use of any particular financial strategy.  All investing, stock forecasts, and investment strategies include the risk of loss for some or even all of your capital.  Before pursuing any financial strategies discussed on this website, you should always consult with a licensed financial advisor.  Put another way, the analysis we provide is for general informational purposes only and does not take into consideration your personal circumstances or other factors that may be important in making decisions.    It should not be considered an individual recommendation or personalized investment advice.  The stocks mentioned may not be suitable for all investors.  As with any investment there is risk.  Past performance is not an indication of future results.  Please do your own due diligence on any stock portfolios highlighted.

Unauthorized reproduction or redistribution of this information or the analysis provided in any form is strictly prohibited.

  • Home
  • Team
  • Research
  • Buy Analysis
  • Market Questions & Data
  • Contact
  • Blog
  • Use Cases
  • Platforms
  • Quantum FAQs
  • Chicago Quantum | Corporate Finance 101
  • 1-hour working session
  • 1-day working session
  • 1-week strategy workshop
  • Analyze up to 3,250 stocks (quantum or classically)
  • 64 Stocks (Quantum & Classical)
  • 64 Stocks (Classical)
  • T-Shirts
  • Custom Algorithm Development
  • Platforms Detail
  • Use Case Detail
  • Market Data
  • Validated tickers
  • Portfolio.m