Blog

Getting Started in Quantum Computing Using Classiq’s Visualizations

7
November
,
2023
Anastasia Marchenkova

Because quantum computing uses complex algorithms and quantum states, there is a steep learning curve breaking in conceptually to this field. Some people say quantum computing is still in the 70’s– that we’re in the era of punch cards and programming on a gate level. In some ways, that’s true. 

The Bloch Sphere provides an excellent entry-point for gaining insight into core quantum concepts such as the states of a quantum bit (“qubit”) visualized on the surface of a sphere. Developing visual intuition of foundational quantum ideas provides a mental map to learning how vital components like single-qubit gates operate in quantum computing. Some quantum platforms specifically cater to gate-level programming, which visually means applying rotations to the Bloch Sphere, but even then struggle with visualizing concepts like entanglement and multi-qubit gates. 

But, just as programming has evolved from dealing with memory management to more abstract languages, quantum computing is experiencing a similar transition. The ability to visualize theoretical, abstract concepts is a core mechanism for advancing quantum computing from its current state into the future. This shift is facilitated by platforms like Classiq that explore quantum concepts through visualizations: circuit synthesis and modeling, constraints, and hardware and software optimization.

Quantum Computing for All with Algorithmic Thinking

These tools contribute to quantum algorithm development by enhancing comprehension, enabling users to make the best possible choices for using quantum computers, and simplifying the process of designing circuits. There’s no need for you to reinvent the wheel with every quantum algorithm. This makes quantum computing more accessible and effective for developers and researchers, both inside quantum and for domain experts in fields outside of quantum computing.

Instead of coding at the gate level, Classiq allows users to focus on the "what" - the algorithm's functionality. Then, it automatically generates the "how" - a circuit that fulfills this functionality while optimizing to real-world constraints. 

This approach offers several advantages:

  • Efficiency: It saves time, especially when dealing with a large number of qubits.
  • Resource Estimation: Users can estimate the resources required to run an algorithm before beginning custom development.
  • Accessibility: It makes quantum computing usable to individuals from outside quantum computing, as experts don't need to delve into low-level hardware intricacies.
  • Future-Proofing: As quantum computers grow in complexity, Classiq's approach remains feasible, whereas low-level coding becomes impractical.

Challenges of Programming “To The Metal”

You shouldn’t need multiple PhDs in quantum physics and computer science, AND domain expertise in chemistry, finance, or aerospace, to be able to use a quantum computer. Unless you want to be Dr. Banner, then, of course, go for it!

With the growing complexity of quantum computers, programming "to the metal" becomes infeasible. While low-level programming still has its place, just like in classical computing, many engineers and domain experts want to harness the power of quantum computing without having to delve into the challenges of hardware engineering, like:

  • Qubit Management Complexity: As you add more qubits, not only do you have to account for the qubits themselves, but you must also manage control over pairwise interactions and two-qubit gates. This requires added control logic and can quickly become unmanageable.
  • Hardware Optimization: Ensuring that the most frequently used qubits remain stable is crucial for efficient quantum computation. This involves understanding the underlying hardware architecture and optimizing code according to daily calibration changes, qubit error rates, and even “dead” qubits. 
  • Exponential Error Correction Complexity: With each new qubit added, the potential interactions and algorithm times increase exponentially, creating more errors (and a new subfield to become an expert in!)

A Visual Journey through Quantum Computing

For the rest of us mere mortals, Classiq isn't just another quantum computing platform; it's a shift in how we design quantum programs. Classiq’s platform emphasizes thinking "algorithmically”. This focuses on “what” an algorithm should achieve rather than the “how” - the functional programming approach of classical computing that opens doors for domain experts to use a quantum computer without needing to understand the system's guts. While loops have no analog in quantum computing! 

Classiq's synthesis engine explores a vast design space to choose the optimal circuit, eliminating the need for manual optimization while also making code more portable across different hardware providers. Beyond just algorithms, Classiq offers:

  • Circuit Visualizers, 
  • Hardware Comparison Tables, and
  • Circuit Connectivity Maps.

These tools not only enhance understanding but also ensure that the chosen quantum architecture remains optimal – without needing hardware-specific knowledge. 

To show how amazing and accessible this can make quantum programming, let’s go through a researcher’s journey using Classiq’s tools to accelerate their research in quantum chemistry. 

Domain Specific Expertise 

The Circuit Visualizer is a  blueprint for understanding quantum circuits and their configurations. It simplifies the learning curve for newcomers by offering a visual representation of quantum circuitry. The domain expert can examine and manipulate constraints on circuits with what they want to accomplish. By abstracting the gate-level details, the Circuit Visualizer opens doors for experts in finance, chemistry, cybersecurity, and domain experts to contribute to optimizing algorithms. 

For example, a quantum chemist using a quantum computer to speed up his or her research should not need to write thousands of lines of low-level Variational Quantum Eigensolver (VQE) code that does chemistry simulation. His or her focus should be on the parts of the problem that require domain expertise, like the chemical structure of compounds being optimized for synthesis or research. 

VQE involves complex quantum circuits and traditionally requires writing thousands of lines of code to implement. However, with Classiq's circuit modeling, this process becomes accessible to a broader range of users. Researchers can rapidly generate optimized quantum circuits for VQE, reducing the time and effort required for implementation. 

Here we can add atoms, spin, charge, the mappings, and pick the number of qubits to generate the structure for the quantum computer to find the energy levels. This allows experts in chemistry to focus on their domain-specific knowledge and the scientific aspects of their research rather than getting bogged down in developing algorithms from scratch. It’s plug-and-play! 

Below, are two options for circuits for European call option pricing. One has been optimized for width (number of qubits in the circuit) and the other for depth (how many gates in a row).

 

By digging into the visualizer, we can see the summary of the circuit information on the left, which includes depth, width, and the number of gates needed to run this algorithm. The circuit generated below, with just one click, is optimized for depth, saving tons of time manually re-writing code on a gate level. 

However, we still can do better. While we have added parameters like the number of qubits, and allowed the model to optimize for the depth or width of the circuit, this circuit is not optimized for real hardware yet.  Remember, this can ALL be changed to allow you to test out different optimizations!

Hardware Awareness with Comparison Tables

"A map is not the territory"

  • Alfred Korzybski 

The circuit generated is not the one directly implemented on the quantum hardware. A high-level quantum algorithm that doesn't depend on specific hardware must be transformed through synthesis (compilation) and translation (transpilation) into instructions that are compatible with the particular quantum hardware – meaning the gates (rotations) it will accept, consolidating a series of gates into a single equivalent gate, and making adjustments such as qubit routing.

In Classiq, we can pick any of the hardware in the list and execute without changing any of our code.  

So you say, okay, cool, but even then, I’m no expert in hardware - which one should I use?

A nifty new feature that saves a ton of time is the Hardware Comparison Tables. Just select the hardware you want to explore and click “Compare Hardware”.  

What comes up is the real resource estimations for specific hardware for this circuit. For this example, we’re seeing that for the simple VQE circuit, IonQ QPU beats IBM’s Guadalupe on all parameters: depth, multi-qubit gate count (which are more error-prone than single qubit gates and take more time), and total gate count. 

Without knowing ANYTHING about the hardware (did you know the IonQ QPUis a trapped ion quantum processor, and IBM Guadelupe is superconducting qubits? Now you know!) we can start to think that the IonQ processor might be better to run your algorithm on.

Now, hardware comparison tables don’t have everything - they don’t have circuit execution time, or error rates here - but it’s a start. Even then, if you’re unsure, you can execute your circuit on both quantum hardware types without extra work, and compare outputs.

There’s no coding, no re-writing of the same code for different platforms, and no manual optimization. This is how we reach quantum advantage.  

Application-Specific Circuits for Deeper Optimization

What if you had your own quantum computer? Our researcher realizes that he or she can use the circuit connectivity map to use the same optimization loops for custom hardware.

While quantum computers right now are based in the cloud, on-prem solutions are likely to grow, based on Hyperion Research: Snapshot of Quantum Computing Market (05/2021). On-premise systems fulfill requirements for many early adopters of quantum computing hardware, which requires data privacy over proprietary data inputs and integration with classical computing for hybrid algorithms. 

But building a full stack quantum software system from scratch for on-premises systems is another barrier to entry.

The Circuit Connectivity Map (CCM) allows the system to have an understanding of qubit connectivity. Meaning, the CCM visualizes the connections between qubits and allows the use of Classiq for custom hardware.

The platform not only focuses on algorithm design but also ensures that hardware is continually linked back to the changes. This symbiotic relationship between software and hardware allows quantum systems to reach quantum advantage. Read more about co-design in the previous blog post in the series, The Key To Full Stack Quantum Computing

Accelerate Innovation

Whether you're a novice in quantum computing or a seasoned expert, you can model the algorithms, synthesize circuits with the optimization parameters most critical to your work, and shortcut that work to focus on what actually matters - the cutting-edge domain expertise that is using quantum computing as a tool for accelerating research. Building intuition for 

Because quantum computing uses complex algorithms and quantum states, there is a steep learning curve breaking in conceptually to this field. Some people say quantum computing is still in the 70’s– that we’re in the era of punch cards and programming on a gate level. In some ways, that’s true. 

The Bloch Sphere provides an excellent entry-point for gaining insight into core quantum concepts such as the states of a quantum bit (“qubit”) visualized on the surface of a sphere. Developing visual intuition of foundational quantum ideas provides a mental map to learning how vital components like single-qubit gates operate in quantum computing. Some quantum platforms specifically cater to gate-level programming, which visually means applying rotations to the Bloch Sphere, but even then struggle with visualizing concepts like entanglement and multi-qubit gates. 

But, just as programming has evolved from dealing with memory management to more abstract languages, quantum computing is experiencing a similar transition. The ability to visualize theoretical, abstract concepts is a core mechanism for advancing quantum computing from its current state into the future. This shift is facilitated by platforms like Classiq that explore quantum concepts through visualizations: circuit synthesis and modeling, constraints, and hardware and software optimization.

Quantum Computing for All with Algorithmic Thinking

These tools contribute to quantum algorithm development by enhancing comprehension, enabling users to make the best possible choices for using quantum computers, and simplifying the process of designing circuits. There’s no need for you to reinvent the wheel with every quantum algorithm. This makes quantum computing more accessible and effective for developers and researchers, both inside quantum and for domain experts in fields outside of quantum computing.

Instead of coding at the gate level, Classiq allows users to focus on the "what" - the algorithm's functionality. Then, it automatically generates the "how" - a circuit that fulfills this functionality while optimizing to real-world constraints. 

This approach offers several advantages:

  • Efficiency: It saves time, especially when dealing with a large number of qubits.
  • Resource Estimation: Users can estimate the resources required to run an algorithm before beginning custom development.
  • Accessibility: It makes quantum computing usable to individuals from outside quantum computing, as experts don't need to delve into low-level hardware intricacies.
  • Future-Proofing: As quantum computers grow in complexity, Classiq's approach remains feasible, whereas low-level coding becomes impractical.

Challenges of Programming “To The Metal”

You shouldn’t need multiple PhDs in quantum physics and computer science, AND domain expertise in chemistry, finance, or aerospace, to be able to use a quantum computer. Unless you want to be Dr. Banner, then, of course, go for it!

With the growing complexity of quantum computers, programming "to the metal" becomes infeasible. While low-level programming still has its place, just like in classical computing, many engineers and domain experts want to harness the power of quantum computing without having to delve into the challenges of hardware engineering, like:

  • Qubit Management Complexity: As you add more qubits, not only do you have to account for the qubits themselves, but you must also manage control over pairwise interactions and two-qubit gates. This requires added control logic and can quickly become unmanageable.
  • Hardware Optimization: Ensuring that the most frequently used qubits remain stable is crucial for efficient quantum computation. This involves understanding the underlying hardware architecture and optimizing code according to daily calibration changes, qubit error rates, and even “dead” qubits. 
  • Exponential Error Correction Complexity: With each new qubit added, the potential interactions and algorithm times increase exponentially, creating more errors (and a new subfield to become an expert in!)

A Visual Journey through Quantum Computing

For the rest of us mere mortals, Classiq isn't just another quantum computing platform; it's a shift in how we design quantum programs. Classiq’s platform emphasizes thinking "algorithmically”. This focuses on “what” an algorithm should achieve rather than the “how” - the functional programming approach of classical computing that opens doors for domain experts to use a quantum computer without needing to understand the system's guts. While loops have no analog in quantum computing! 

Classiq's synthesis engine explores a vast design space to choose the optimal circuit, eliminating the need for manual optimization while also making code more portable across different hardware providers. Beyond just algorithms, Classiq offers:

  • Circuit Visualizers, 
  • Hardware Comparison Tables, and
  • Circuit Connectivity Maps.

These tools not only enhance understanding but also ensure that the chosen quantum architecture remains optimal – without needing hardware-specific knowledge. 

To show how amazing and accessible this can make quantum programming, let’s go through a researcher’s journey using Classiq’s tools to accelerate their research in quantum chemistry. 

Domain Specific Expertise 

The Circuit Visualizer is a  blueprint for understanding quantum circuits and their configurations. It simplifies the learning curve for newcomers by offering a visual representation of quantum circuitry. The domain expert can examine and manipulate constraints on circuits with what they want to accomplish. By abstracting the gate-level details, the Circuit Visualizer opens doors for experts in finance, chemistry, cybersecurity, and domain experts to contribute to optimizing algorithms. 

For example, a quantum chemist using a quantum computer to speed up his or her research should not need to write thousands of lines of low-level Variational Quantum Eigensolver (VQE) code that does chemistry simulation. His or her focus should be on the parts of the problem that require domain expertise, like the chemical structure of compounds being optimized for synthesis or research. 

VQE involves complex quantum circuits and traditionally requires writing thousands of lines of code to implement. However, with Classiq's circuit modeling, this process becomes accessible to a broader range of users. Researchers can rapidly generate optimized quantum circuits for VQE, reducing the time and effort required for implementation. 

Here we can add atoms, spin, charge, the mappings, and pick the number of qubits to generate the structure for the quantum computer to find the energy levels. This allows experts in chemistry to focus on their domain-specific knowledge and the scientific aspects of their research rather than getting bogged down in developing algorithms from scratch. It’s plug-and-play! 

Below, are two options for circuits for European call option pricing. One has been optimized for width (number of qubits in the circuit) and the other for depth (how many gates in a row).

 

By digging into the visualizer, we can see the summary of the circuit information on the left, which includes depth, width, and the number of gates needed to run this algorithm. The circuit generated below, with just one click, is optimized for depth, saving tons of time manually re-writing code on a gate level. 

However, we still can do better. While we have added parameters like the number of qubits, and allowed the model to optimize for the depth or width of the circuit, this circuit is not optimized for real hardware yet.  Remember, this can ALL be changed to allow you to test out different optimizations!

Hardware Awareness with Comparison Tables

"A map is not the territory"

  • Alfred Korzybski 

The circuit generated is not the one directly implemented on the quantum hardware. A high-level quantum algorithm that doesn't depend on specific hardware must be transformed through synthesis (compilation) and translation (transpilation) into instructions that are compatible with the particular quantum hardware – meaning the gates (rotations) it will accept, consolidating a series of gates into a single equivalent gate, and making adjustments such as qubit routing.

In Classiq, we can pick any of the hardware in the list and execute without changing any of our code.  

So you say, okay, cool, but even then, I’m no expert in hardware - which one should I use?

A nifty new feature that saves a ton of time is the Hardware Comparison Tables. Just select the hardware you want to explore and click “Compare Hardware”.  

What comes up is the real resource estimations for specific hardware for this circuit. For this example, we’re seeing that for the simple VQE circuit, IonQ QPU beats IBM’s Guadalupe on all parameters: depth, multi-qubit gate count (which are more error-prone than single qubit gates and take more time), and total gate count. 

Without knowing ANYTHING about the hardware (did you know the IonQ QPUis a trapped ion quantum processor, and IBM Guadelupe is superconducting qubits? Now you know!) we can start to think that the IonQ processor might be better to run your algorithm on.

Now, hardware comparison tables don’t have everything - they don’t have circuit execution time, or error rates here - but it’s a start. Even then, if you’re unsure, you can execute your circuit on both quantum hardware types without extra work, and compare outputs.

There’s no coding, no re-writing of the same code for different platforms, and no manual optimization. This is how we reach quantum advantage.  

Application-Specific Circuits for Deeper Optimization

What if you had your own quantum computer? Our researcher realizes that he or she can use the circuit connectivity map to use the same optimization loops for custom hardware.

While quantum computers right now are based in the cloud, on-prem solutions are likely to grow, based on Hyperion Research: Snapshot of Quantum Computing Market (05/2021). On-premise systems fulfill requirements for many early adopters of quantum computing hardware, which requires data privacy over proprietary data inputs and integration with classical computing for hybrid algorithms. 

But building a full stack quantum software system from scratch for on-premises systems is another barrier to entry.

The Circuit Connectivity Map (CCM) allows the system to have an understanding of qubit connectivity. Meaning, the CCM visualizes the connections between qubits and allows the use of Classiq for custom hardware.

The platform not only focuses on algorithm design but also ensures that hardware is continually linked back to the changes. This symbiotic relationship between software and hardware allows quantum systems to reach quantum advantage. Read more about co-design in the previous blog post in the series, The Key To Full Stack Quantum Computing

Accelerate Innovation

Whether you're a novice in quantum computing or a seasoned expert, you can model the algorithms, synthesize circuits with the optimization parameters most critical to your work, and shortcut that work to focus on what actually matters - the cutting-edge domain expertise that is using quantum computing as a tool for accelerating research. Building intuition for 

About "The Qubit Guy's Podcast"

Hosted by The Qubit Guy (Yuval Boger, our Chief Marketing Officer), the podcast hosts thought leaders in quantum computing to discuss business and technical questions that impact the quantum computing ecosystem. Our guests provide interesting insights about quantum computer software and algorithm, quantum computer hardware, key applications for quantum computing, market studies of the quantum industry and more.

If you would like to suggest a guest for the podcast, please contact us.

Start Creating Quantum Software Without Limits

contact us