Skip to main content
IBM Quantum Platform

InnerProduct

class qiskit.circuit.library.InnerProduct(num_qubits)

GitHub

ベース: QuantumCircuit

F2F_2 上の2つのn量子ビットベクトルの内積を計算する 2n-qubit ブール関数。

この実装は、以下の変換を計算するフェイズオラクルである。

IP2n:F22n1,1IP2n(x1,,xn,y1,,yn)=(1)x.y\mathcal{IP}_{2n} : F_2^{2n} \rightarrow {-1, 1} \mathcal{IP}_{2n}(x_1, \cdots, x_n, y_1, \cdots, y_n) = (-1)^{x.y}

対応するユニタリーは対角であり、トップ・レジスタとボトム・レジスタの内積が1である任意の入力に対して -1。 そうでなければ、入力をそのまま維持する。

q0_0: ─■──────────

q0_1: ─┼──■───────
       │  │
q0_2: ─┼──┼──■────
       │  │  │
q0_3: ─┼──┼──┼──■─
       │  │  │  │
q1_0: ─■──┼──┼──┼─
          │  │  │
q1_1: ────■──┼──┼─
             │  │
q1_2: ───────■──┼─

q1_3: ──────────■─

基準回路:

先に説明した回路を示す図。
バージョンから非推奨 2.1

クラス qiskit.circuit.library.boolean_logic.inner_product.InnerProduct は Qiskit 2.1 で非推奨となりました。 Qiskit 3.0 で削除されます。 代わりに qiskit.circuit.library.InnerProductGate。

パラメーター

num_qubits (int) – 上下レジスタの幅(回路全体の幅の半分)


属性

name

タイプ: str

人間が読める回路名。

from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
my_circuit
このページは役に立ちましたか?
バグや誤字の報告、またはコンテンツの要求はGitHubで行ってください。