Skip to main content
IBM Quantum Platform

構成のプールにフェルミオン遷移を追加する

ここでは、各電子配置に対して遷移演算子を作用させることによって得られる電子配置の 集合を拡張する機能について示す。

我々は、次のような単一電子ホップを追加する方法を示す:

cpσ†cqσ∣x⟩c^\dagger_{p\sigma} c_{q\sigma} |\textbf{x} \rangle

p,q=1,...,Norbp, q = 1, ..., N_\textrm{orb} および σ∈{↑,↓}\sigma \in \{ \uparrow, \downarrow\} について、 ならびに電子配置のバッチに含まれるすべての ∣x⟩|\textbf{x} \rangle について。

まず、ランダムな電子配置のバッチを生成することから始めます:

import numpy as np

n_qubits = 8
n_orb = n_qubits // 2

rand_seed = 22
np.random.seed(rand_seed)


# Generate some random bitstrings for testing
def random_bitstrings(n_samples, n_qubits):
    return (
        np.round(np.random.rand(n_samples, n_qubits))
        .astype("int")
        .astype("bool")
    )


bitstring_matrix = random_bitstrings(100, n_qubits)

励起演算子は、その長さが フェルミオンノード(または量子ビット)の数と等しいnumpy配列内に指定されます。 配列の各要素は、 以下の値をとることができる文字列でなければなりません:

  • 'I': アイデンティティ
  • '+': 生成演算子
  • '-': 消滅演算子

(同一スピン種の間の)考えられるすべての単一電子遷移を生成します。 (同一スピン種の間の)

transitions_single = np.array(
    [
        ["I" for i in range(2 * n_orb)]
        for j in range(4 * (n_orb**2 - n_orb) // 2 + 1)
    ]
)
count = 1
for i in range(n_orb):
    for j in range(i + 1, n_orb):
        # spin up
        transitions_single[count, i] = "+"
        transitions_single[count, j] = "-"
        count += 1
        transitions_single[count, i] = "-"
        transitions_single[count, j] = "+"
        count += 1

        # spin down
        transitions_single[count, i + n_orb] = "+"
        transitions_single[count, j + n_orb] = "-"
        count += 1
        transitions_single[count, i + n_orb] = "-"
        transitions_single[count, j + n_orb] = "+"
        count += 1

print(transitions_single)

Output:

[['I' 'I' 'I' 'I' 'I' 'I' 'I' 'I']
 ['+' '-' 'I' 'I' 'I' 'I' 'I' 'I']
 ['-' '+' 'I' 'I' 'I' 'I' 'I' 'I']
 ['I' 'I' 'I' 'I' '+' '-' 'I' 'I']
 ['I' 'I' 'I' 'I' '-' '+' 'I' 'I']
 ['+' 'I' '-' 'I' 'I' 'I' 'I' 'I']
 ['-' 'I' '+' 'I' 'I' 'I' 'I' 'I']
 ['I' 'I' 'I' 'I' '+' 'I' '-' 'I']
 ['I' 'I' 'I' 'I' '-' 'I' '+' 'I']
 ['+' 'I' 'I' '-' 'I' 'I' 'I' 'I']
 ['-' 'I' 'I' '+' 'I' 'I' 'I' 'I']
 ['I' 'I' 'I' 'I' '+' 'I' 'I' '-']
 ['I' 'I' 'I' 'I' '-' 'I' 'I' '+']
 ['I' '+' '-' 'I' 'I' 'I' 'I' 'I']
 ['I' '-' '+' 'I' 'I' 'I' 'I' 'I']
 ['I' 'I' 'I' 'I' 'I' '+' '-' 'I']
 ['I' 'I' 'I' 'I' 'I' '-' '+' 'I']
 ['I' '+' 'I' '-' 'I' 'I' 'I' 'I']
 ['I' '-' 'I' '+' 'I' 'I' 'I' 'I']
 ['I' 'I' 'I' 'I' 'I' '+' 'I' '-']
 ['I' 'I' 'I' 'I' 'I' '-' 'I' '+']
 ['I' 'I' '+' '-' 'I' 'I' 'I' 'I']
 ['I' 'I' '-' '+' 'I' 'I' 'I' 'I']
 ['I' 'I' 'I' 'I' 'I' 'I' '+' '-']
 ['I' 'I' 'I' 'I' 'I' 'I' '-' '+']]

bitstring_matrixここで、遷移演算子を の構成に適用します:

from qiskit_addon_sqd.fermion import enlarge_batch_from_transitions

bitstring_matrix_aug = enlarge_batch_from_transitions(
    bitstring_matrix, transitions_single
)

print(bitstring_matrix_aug.shape)
print(bitstring_matrix_aug)

Output:

(723, 8)
[[False False False ... False False  True]
 [False  True False ...  True False False]
 [ True  True  True ...  True False  True]
 ...
 [ True False  True ... False False  True]
 [ True  True  True ...  True False  True]
 [False False False ... False False  True]]
このページは役に立ちましたか?
バグや誤字の報告、またはコンテンツの要求はGitHubで行ってください。