TwoLocal
Qiskit が提供する、汎用のパラメータ付き回路テンプレート。 HEA の実装のひとつ。
構成要素#
| 要素 | 指定するもの | 例 |
|---|---|---|
| 回転ブロック | 1 量子ビットゲート | ry、rz、['ry','rz'] |
| もつれブロック | 2 量子ビットゲート | cx、cz |
| もつれ方 | 接続パターン | full、linear、circular |
| 繰り返し | 層の数 | reps |
名前の "two-local" は、2 量子ビットまでの操作だけで構成されることを指す。
パラメータ数#
回転ブロックが 種類、量子ビット 、層 のとき
たとえば ry のみ、、reps=3 なら 16 個。
パラメータ数が増えると
もつれ方の選択#
| パターン | CNOT 数 | 特徴 |
|---|---|---|
linear |
隣接のみ。実機に優しい | |
circular |
端どうしも繋ぐ | |
full |
全対全。実機では SWAP が大量に要る |
実機では linear が現実的。
full は理論的な表現力は高いが、
トランスパイル後の深さが跳ね上がる。
参考文献#
- Qiskit Documentation: TwoLocal https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TwoLocal
- Abhinav Kandala et al. Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets. Nature 549, 2017. https://doi.org/10.1038/nature23879
- Marco Cerezo et al. Variational quantum algorithms. Nature Reviews Physics 3, 2021. https://doi.org/10.1038/s42254-021-00348-9