Quantum Engineering

Cardiac Anomaly Detection using Azure Quantum Workspace

We begin with a simple goal:
How to speed up cardiac anomaly detection?

Current technology uses classical computing to apply Fast Fourier Transforms (FFT) to wavelets or spectrograms using input signals from ECG sensors. But classical computing involves a very long time to calculate the output, thus being useful only in research of ECG anomaly detection.

What if there is a way to use Quantum Computing to apply the Quantum Fourier Transform algorithm to the same problem? If we can pull this off, we could potentially disrupt Cardiac Anomaly Detection into a dramatic shift in treatment speed and methodology for cardiac care!

To understand how to apply Quantum Computing to solve this problem, there are several engineering steps with a plethora of decisions to be made in order to execute a solution:

We look at existing data sets on Electrocardiogram (ECG) that are publicly available for research.

We look at current methods to detect ECG anomalies.

We begin a hypothesis to design experiments to prove or disprove it.

We select the right tools to implement, run and analyze the experiments and its results.

We select the platform and develop the software to conduct the experiments on the platform of choice.

We pre-process the data set to get it ready to supply the platform running the software in the required form.

We design and standup the system architecture on the platform of choice and conduct “stub runs” using the software to develop and debug it.

We run the full dataset on the software as a simulation to learn how to post-process the results in a concise presentable (and interpretable) form.

We also measure the usage patterns to project the exact resolution to obtain results that fit in a budget allocated for the use of the platform and optimize it for usable results within the budget allocated for the project.

We finally run it on the platform using the real device with the same software.

We post-process the real device results and compare with the simulated results to obtain the delta between the two and determine if the platform chosen is usable to extend to real-life scenarios.

Each of these steps requires active decisions and agility that a tightly integrated platform must provide in order to develop the code, version it, as well as deploy it to the platform for execution and capturing results in a resilient manner.

Using the above points, lets examine our journey as Pivotport, Inc. embarked on this experiment to get to a real-world scenario.

In August 2021, Pivotport, Inc. applied to the Microsoft Azure Quantum Credits program with intent to conduct the above experiment and obtain results on the IonQ provider via a new Pivotport Azure Quantum Workspace. Since then, we received three approvals for $10,000 in Azure Quantum Credits via the program for IonQ, Quantinuum and Rigetti providers respectively.

In September 2021, we embarked on the project. Using the Azure Quantum Workspace instructions, we built the Pivotport Azure Quantum Workspace as well as an Azure DevOps environment with a Repository for this project.

We chose Visual Studio Enterprise as well as Visual Studio Code to develop our Python codebase via the Azure DevOps Repository. Installing Python and viewing Jupyter Notebooks is much easier in VS Enterprise as its fairly easy to keep the Python packages updated in the Python environment. But running the Jupyter Notebooks with our Python code was found to be possible in VS Code. This link shows how to use your IDE to submit jobs to Azure Quantum. If you prefer to run Jupyter Notebooks directly in your Azure Quantum Workspace, here is how to do so.

We installed Python with all necessary modules in Visual Studio Enterprise on our dev machines to develop Python based Jupyter Notebooks for the Quantum Fourier Transform algorithm to apply to ECG records to detect anomalies. These included WFDB, Numpy, Matplotlib, Scipy and Azure Quantum with the IonQ provider.

To visualize a Quantum Fourier Transform Circuit in action, you can use an online simulator such as this one.

We also precalculated the gate-shot estimates using Excel to ensure we were using the right qubit count, gate count in our quantum circuit to get the right resolution which fit in our budgeted Azure Quantum Credits. Below is an example of how we approached this, before the Azure Quantum Resource Estimator became available.

We then proceeded to try out our Jupyter Notebook using the Pivotport Azure Quantum Workspace connection declared within it, integrated with the Azure Active Directory user ID and MFA to conduct secure execution via the IonQ provider on the IonQ Simulator as well as IonQ Harmony and Aria platforms. This took several months of debugging and we finally succeeded in tachycardia and ventricular ectopy records being executed on IonQ simulator, as described in this blog.

We have successfully demonstrated our code detects ECG anomalies in a single standardized Quantum Cardiac Spectrogram of an ECG of any given record length, provided we have sufficient Azure Quantum Credits or subscription allocation to support the required IonQ gate-shot estimates.

We are currently working towards executing single records on IonQ Harmony, Aria, Quantinuum Simulator and H1, H2 and Rigetti M1, M2, M3 platforms to demonstrate comparability between results using the same resolution and circuit depths and gate-shot counts.

We are looking for further support in our research on Quantum Cardiac Spectrograms using QFT algorithm driven Quantum Computing tied to a hybrid Azure IoT solution for ECG monitoring as a real life hybrid cloud-quantum service that we intend to bring to market as a global cardiac anomaly detection and identification solution.

We thank Microsoft for having provided support for our egalitarian project through over $50000 in Azure Quantum Credits for our work, and hope to do more during next year with this support!

Happy Holidays to all! This blog is one of the entries for 12/22/2022 on


Please consider donating to our research through visiting this link. It will help us tremendously as we have been running in bootstrap mode and are in need of funding support!

The Pivotport Quantum Engineering Team:

Jonathan Ortega: Quantum Development Intern

Rajiv Mistry: CEO, Pivotport, Inc.

Quantum Engineering

Executing Microsoft Quantum Topological Dataset Notebooks

Microsoft recently released its Topological Quantum Computing dataset for anyone to try out. This post describes how to do so.

As shown in this article, you can create an Azure Quantum Workspace and within its Notebooks tab, visit the available notebooks under Topological Quantum Computing.

There are three notebooks available to review:

  • Analysis of device data from preprint paper
  • First stage of topological gap protocol
  • Second stage of topological gap protocol

To view and run a notebook:

  1. In your new workspace, select Notebooks and then select Topological quantum computing.
  2. Select your desired notebook, and select Copy to my notebooks.Copy sample notebook.

Once you open your Azure Quantum Workspace, Select Topological Quantum Computing. Copy each into your notebooks, which is the third item among your listed Jupyter Notebooks.

Opening each starts a new Jupyter Server instance within your Azure Quantum Workspace. Study it, then click run all.

Each notebook should execute within a few minutes and populate the cells with results – data or graphics.

In case you want to see the outputs you can read this paper which contains all the graphics that are generated using these three notebooks. Below is a Zipfile containing execution results from Pivotport Quantum Workspace if you wish to examine them in your own Jupyter Server.

Quantum Engineering

Chapter in “Quantum Computer Music” published by Springer

Rajiv Mistry and Jonathan Ortega of Pivotport, Inc. were invited by Eduardo Miranda, editor of the book “Quantum Computer Music” to author a chapter titled “Experiments in Quantum Frequency Detection using the Quantum Fourier Transform” after they presented the topic at the first International Symposium for Quantum Computing in Musical Creativity, hosted by University of Plymouth in late 2021.

The book is published by Springer and available!

Quantum Engineering

Elevator Pitch: Pivotport Inc.

Excerpts from “Quantum Computing in Healthcare in Life Sciences” Webinar by Nardo Manaloto

What is Quantum Engineering, Computing, Detection, Sensing & Noise?
Explanation of Quantum Engineering, Computing, Detection, Sensing, Noise by Rajiv Mistry @ 1:47:15

Pivotport Elevator Pitch
Pivotport Elevator Pitch by Rajiv Mistry @1:50:59

Our startup is developing a cutting-edge technology for early detection and identification of cardiac anomalies using quantum computing. By harnessing the power of quantum computing, our technology is able to analyze vast amounts of data from electrocardiograms and generate cardiac spectrograms, to provide highly accurate and actionable results to support quicker cardiac anomaly diagnosis.

This technology has the potential to revolutionize the way cardiac anomalies are detected and treated, leading to better outcomes for patients and significant cost savings for the healthcare system. With your investment, we will be able to bring this innovative technology to market and make a real impact on people’s lives.

Additionally, we are also targeting to expand our technology to other medical applications such as brain anomalies detection.

We are seeking funding to support the development and commercialization of our technology. With your support, we can bring Quantum Cardiac Anomaly Detection to the market and change the way cardiac anomalies are detected and treated.

Thank you for considering our proposal. We would be happy to discuss this opportunity further with you and answer any questions you may have. Please connect by booking a Teams call via the Contact page.

Quantum Engineering

Pivotport granted $10K in Azure Quantum Credits for Rigetti Provider

Microsoft Azure Quantum Credits for $10K for Rigetti Provider were granted to Pivotport, Inc. to continue its development of the Quantum Cardiac Detector and Identifier project through simulator and QPU use.

Quantum Engineering

Pivotport granted $10K in Azure Quantum Credits for IonQ Aria

Microsoft Azure Quantum Group has granted use of $10K worth of Azure Quantum Credits for Aria, the IonQ Quantum Computer available on Azure as of today.

This is in addition to the prior grant of a similar amount of credits for Harmony by IonQ during September 2021.

We will continue to pilot the Quantum Cardiac Detector software using these credits towards QPU driven processing of ECG signals.

Quantum Engineering

Pivotport granted $10K in Azure Quantum Credits for Quantinuum Provider

Microsoft Azure Quantum Credits for $10K for Quantinuum Provider were granted to Pivotport, Inc. to continue its development of the Quantum Cardiac Detector and Identifier project through simulator and QPU use.

Updates on this work will be posted in this post in the future.

Quantum Engineering

Pivotport, Inc. selected to join Microsoft for Startups Founders Hub.

Pivotport, Inc. is excited to announce that it is a proud Microsoft for Startups Founders Hub Partner.

Due to this partnership, Pivotport, Inc. will be receiving much needed support to advance its Quantum Cardiac Detector and Identifier project starting from the Ideate stage and advancing along Develop, Grow and Scale stages.

The program offers many benefits, including upto $150000 worth of Azure Credits, Microsoft 365 credits, Dynamics 365 credits as well as Visual Studio Enterprise credits along with many additional third party partner benefits such as Github for Enterprise, OpenAI, Drata, and Ansarada.

Quantum Engineering

Pivotport, Inc. joins QED-C

Pivotport, Inc. has joined The Quantum Economic Development Consortium. We look forward to engaging with the Technology Adoption Committees and working with industry and academia to help advance our Quantum workforce through mentoring and internships in advanced Quantum Engineering engagements.

More information on QED-C is found here.

Quantum Engineering

Pivotport, Inc selected for Azure Quantum Private Preview for IonQ

Project Name: Quantum detection of cardiovascular events in cardiac signals

Credits Granted to Pivotport, Inc. by Microsoft Azure Quantum Program:

$10000 USD worth usage of Azure Quantum Service for the IonQ QPU provider. Unlimited usage for the IonQ Simulator.

The above credits will be made available to Pivotport, Inc. starting on October 1, 2021, and expiring on June 30, 2022.

Pivotport, Inc. is currently in the planning phase to conduct this project on Quantum Computing platforms such as IonQ (preview available via Azure Quantum) available via Microsoft Azure.

Update: February 27, 2022: Pivotport has completed execution of its quantum frequency detector on Azure Quantum via the IonQ provider using IonQ Simulator as well as IonQ QPU in preparation for the upcoming trials for cardiac waveforms. A total of 60 million gate shots were applied on a test QFT circuit to ingest and process signals on the IonQ hardware this morning with results to be published soon.

Update: March 17, 2022:

Left: First successful simulation execution to detect a Quantum Cardiac Anomaly.
Right: Classical computing based image to detect a Cardiac Anomaly.

We are racing to complete the Quantum code and execute it on IonQ via Azure Quantum by end of March. We plan to publish results during April.

Update: April 11, 2022:

We have used publicly available cardiovascular ECG datasets to develop the below Quantum Spectrograms which depict different cardiac events using a frequency and time based spectrum. These have been obtained as output from IonQ Simulator executions run in Jupyter Notebook that calls the IonQ provider from an Azure Quantum Workspace.

We are now awaiting the availability of IonQ’s latest device, Aria on Pivotport’s Microsoft Azure Quantum Workspace to execute the Quantum code on its Quantum Processing Unit (QPU).

We will determine the time to compute on Aria and compare each run with Classical Computing executions of the same outputs. The goal is to understand if there is a significant speed advantage in using Quantum Computing to detect ECG anomalies as a potential application in the cardiac ward of a hospital.

The dataset we used had only seven ECG that were continuous, and we have executed anomaly detection Quantum Spectrograms on six of these shown below.

Ventricular Tachycardia: Each ECG was 8 minutes long.

Update April 30, 2022:
We have started conducting further refinements to improve resolution of the Quantum Spectrograms using a total of 16513 IonQ Simulator jobs since late March till early May in preparation for the QPU based execution of the same record set to commence soon. In the first dataset, we used Ventricular Tachycardia ECG signals. A second data set of ECG signals for Ventricular Ectopy has also been processed to generate the below images of the frequency spectrum across the entire captured signal for each image.

Ventricular Ectopy: Each ECG was 35 minutes long.

We conducted very successful simulations using the IonQ Simulator provider via the Pivotport Quantum Workspace over the last weekend of April.

The first set of ECGs we had used in the prior simulation were for Ventricular Tachycardia, with 8 minutes duration for each of 7 continuous ECGs. 

The second set of ECGs we used in the latest simulation were for Ventricular Ectopy, with 35 minutes duration for each of 22 continuous ECGs. 

Both types of ventricular cardiac anomalies may occur in Covid-19 recovered patients and can indicate cardiac tissue damage and elevated risk of cardiac disease, among many other causes. Due to the large recovered patient base, high speed processing could allow faster decision support for diagnosis, so Quantum Advantage could be very important in the solution for this problem.

Due to four times longer duration, the second dataset took a lot more jobs to execute. Approximately four times as many as the first dataset, to generate the Quantum Spectrograms. 

We plan to calculate the number of Tachycardia and Ectopy ECGs possible to process their Quantum Spectrograms using QPU execution with the Azure Credits we have, for a total not exceeding 333M gate shots. 

We will get important learnings from this:

1) Duration to simulate compared to duration to execute on QPU for Quantum Spectrograms. This may demonstrate quantum advantage for such detection. 

2) Qualitative comparison of Phase 1 (Detection) Quantum Spectrograms between simulated and QPU execution. This may determine if there is noise in the QPU based results thus giving us insights into the speed versus quality tradeoff between simulation and QPU calculations, which in turn will drive the Phase 2 (Identification) QML based certainty for simulated versus QPU results.

We used a total of over 16000 jobs to simulate the results so far. The initial test simulations for the first 1000 jobs were to debug our code. The next 3000 jobs were for the first dataset for Tachycardia. The remaining 12000 jobs were for the second dataset for Ectopy.