ブログ
30
1月
,
2022

Circuit of the month Jan 22: a hardware-efficient variational circuit

記事をシェア
ライブラリ

Given a molecule, the Hamiltonian describes the interactions between all electrons and nuclei.

Calculating the energies of a molecular Hamiltonian, and especially its ground state, allows us to understand the chemical properties of a molecule. Since the molecular Hamiltonian is inherently quantum, quantum computing can be used to calculate such properties efficiently by leveraging the same quantum effects in appropriate quantum algorithms. This is done in 3 steps:

  1. Calculating the molecular Hamiltonian for the desired molecule.
  2. Generating an appropriate variational quantum circuit to calculate the Hamiltonian's ground state. Today, we will focus on this step, demonstrate how to create a variational circuit.
  3. Executing the desired quantum circuit as part of a hybrid quantum-classical algorithm.

The ground state of a Hamiltonian is found by using an appropriate variational quantum circuit (usually called an Ansatz), and then combining it with a classical optimizer to find the minimal expectation value for the Hamiltonian. In NISQ-era devices, short and hardware-fitting quantum circuits are preferred, to reduce the noise and get better results.

In the following example, we demonstrate how to generate a hardware-efficient Ansatz, i.e. an Ansatz that is generated to fit a specific hardware.

In this example we will use a 4-qubit hardware, with full connectivity.

Using Classiq's textual model, the code looks like this:


{
    "quantum_circuit_constraints": {
        "max_depth": 100,
        "max_width": 4,
        "logic_flow": [
            {
                "function": "HardwareEfficientAnsatz",
                "function_params": {
                    "num_qubits": 4,
                    "connectivity_map": [
                        [0,1],
                        [0,2],
                        [0,3],
                        [1,2],
                        [1,3],
                        [2,3]
                    ],
                    "reps": 2
                }
            }
        ]
    }
}

Alternatively, one can synthesize the same circuit using Classiq's Python SDK:


from classiq import ModelDesigner
from classiq.builtin_functions import HardwareEfficientAnsatz

NUM_QUBITS = 4
FULLY_CONNECTED_MESH = [ [0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3] ]
hwea_params = HardwareEfficientAnsatz(
    num_qubits=NUM_QUBITS,
    connectivity_map=FULLY_CONNECTED_MESH,
    reps=2
)
model_designer = ModelDesigner()
model_designer.HardwareEfficientAnsatz(params=hwea_params)
generation_result = model_designer.synthesize()

Here is the resulting output circuit:

alt text

 

Given a molecule, the Hamiltonian describes the interactions between all electrons and nuclei.

Calculating the energies of a molecular Hamiltonian, and especially its ground state, allows us to understand the chemical properties of a molecule. Since the molecular Hamiltonian is inherently quantum, quantum computing can be used to calculate such properties efficiently by leveraging the same quantum effects in appropriate quantum algorithms. This is done in 3 steps:

  1. Calculating the molecular Hamiltonian for the desired molecule.
  2. Generating an appropriate variational quantum circuit to calculate the Hamiltonian's ground state. Today, we will focus on this step, demonstrate how to create a variational circuit.
  3. Executing the desired quantum circuit as part of a hybrid quantum-classical algorithm.

The ground state of a Hamiltonian is found by using an appropriate variational quantum circuit (usually called an Ansatz), and then combining it with a classical optimizer to find the minimal expectation value for the Hamiltonian. In NISQ-era devices, short and hardware-fitting quantum circuits are preferred, to reduce the noise and get better results.

In the following example, we demonstrate how to generate a hardware-efficient Ansatz, i.e. an Ansatz that is generated to fit a specific hardware.

In this example we will use a 4-qubit hardware, with full connectivity.

Using Classiq's textual model, the code looks like this:


{
    "quantum_circuit_constraints": {
        "max_depth": 100,
        "max_width": 4,
        "logic_flow": [
            {
                "function": "HardwareEfficientAnsatz",
                "function_params": {
                    "num_qubits": 4,
                    "connectivity_map": [
                        [0,1],
                        [0,2],
                        [0,3],
                        [1,2],
                        [1,3],
                        [2,3]
                    ],
                    "reps": 2
                }
            }
        ]
    }
}

Alternatively, one can synthesize the same circuit using Classiq's Python SDK:


from classiq import ModelDesigner
from classiq.builtin_functions import HardwareEfficientAnsatz

NUM_QUBITS = 4
FULLY_CONNECTED_MESH = [ [0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3] ]
hwea_params = HardwareEfficientAnsatz(
    num_qubits=NUM_QUBITS,
    connectivity_map=FULLY_CONNECTED_MESH,
    reps=2
)
model_designer = ModelDesigner()
model_designer.HardwareEfficientAnsatz(params=hwea_params)
generation_result = model_designer.synthesize()

Here is the resulting output circuit:

alt text

 

"Qubit Guyのポッドキャスト "について

The Qubit Guy(弊社最高マーケティング責任者ユヴァル・ボーガー)がホストを務めるこのポッドキャストは、量子コンピューティングのオピニオンリーダーをゲストに迎え、量子コンピューティングのエコシステムに影響を与えるビジネスや技術的な疑問について議論します。ゲストは、量子コンピュータのソフトウェアやアルゴリズム、量子コンピュータのハードウェア、量子コンピューティングの主要なアプリケーション、量子産業の市場調査などについて興味深いインサイトを提供します。

ポッドキャストへのゲスト推薦をご希望の方は、こちらまでご連絡ください

さらに見る

見つかりませんでした。

量子ソフトウェア開発を開始

お問い合わせ