情 ★報 ・科 ・学
Lヨ1躍 ゴン胃M …タ1尚 西嗣酋朗 暫
躍
R 本書 の 無 断複 写 は,著 作権 法 上 で の例 外 を除 き,禁 じられ て い ます 。 本 書 は,日 本 複 写権 セ ン ター 「出版 物 ...
52 downloads
786 Views
20MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
情 ★報 ・科 ・学
Lヨ1躍 ゴン胃M …タ1尚 西嗣酋朗 暫
躍
R 本書 の 無 断複 写 は,著 作権 法 上 で の例 外 を除 き,禁 じられ て い ます 。 本 書 は,日 本 複 写権 セ ン ター 「出版 物 の 複 写 利用 規 程 」 で定 め る特別 許諾 を必要 とす る出 版物 です 。 本 書 を複 写 され る場 合 は,す で に 日本 複 写 権 セ ン ター と包 括 契約 を され て い る方 も事 前 に 日本 複写 権 セ ン タ ー(03-3401-2382)の
許 諾 を 得 て くだ さ い
。
は じめ に
本 書 の 目的 は,最 近 話 題 に な っ て い る 量 子 コ ン ピュ ー タ の概 念 を,な るべ く多 くの 読 者 に正 し く理 解 して い た だ くこ とで あ る.そ の た め に,量 子 コ ン ピュ ー タ の 根 底 に あ る考 え 方 を,計 算 機 科 学 の 立 場 か ら な るべ く平 易 に解 説 す る こ と を心 が け た.ま た,量 子 コ ン ピ ュ ー タ上 にお け る効 率 的 な ア ル ゴ リズ ム 設計 法 や,量 子 コ ン ピュ ー タの 実 現 可 能 性 につ い て も紹 介 した. 実 は,量
子 コ ン ピ ュ ー タ は ま だ 実 現 で き て い な い し,近
も 考 え ら れ て い な い.現 な く,量
子Turing機
在 考 案 さ れ て い る の は,量
い 将 来 に実 用 に な る と
子 コ ン ピュ ー タそ の もの で は
械 と い う量 子 コ ン ピ ュ ー タ の 数 学 的 モ デ ル な の で あ る.
理 論 の 重要 な役割 の 一 つ は未 来 を予 見 す る こ とで あ る.英 国 の数 学 者Alan Turing が 偉 大 だ っ た の は,コ
ン ピュ ー タが 影 も形 もな か っ た1930年
ピュ ー タの 数 学 的 モ デ ルで あ るTuring機
代 に,現 在 の コ ン
械 を考 案 した 点 に あ る .
とこ ろ で,現 在 の コ ン ピ ュ ー タの 数 学 的 モデ ルがTuring機 そ れ らの構 造 は あ ま り に異 な っ て い るの で,す
械 だ とい わ れ て も,
ぐ に は納 得 で き な い 方 が 多 い だ ろ
う.現 在 の 我 々で す らそ の よ うな状 況 な の だ か ら,Turing機
械が考案 された当時
の 人 々 に は,現 在 の コ ン ピ ュ ー タの 実 現 形 態 は ま っ た く想 像 で きな か っ た はず で あ る.そ れ と同 じ よ うに,量 子Turing機 に は,も
械 が 考 案 され て ま だ間 もな い現 在 の我 々
し量 子 コ ン ピュ ー タが 未 来 に 実 現 され る と して も,そ の 姿 が 想 像 で き な
い の は 当 然 の こ とで あ る. 本書 を読 ん で,量 子Turing機
械 に興 味 を持 た れ た ら,是 非,そ
方 法 に も思 い を はせ て い た だ きた い.世
の物理 的実現
界 初 の 量 子 コ ン ピュ ー タが 日本 で 開 発 さ
れ た ら,ど ん な に 素 晴 ら しい こ とで あ ろ うか.
本 書 の構 成 本 書 の 第 Ⅰ部(第1∼3章)は
イ ンフ ォー マ ル な解 説 にあ て た.第
Ⅰ部 を お 読 み
い た だ くだ け で,前 提 知 識 な しに,量 子 コ ン ピ ュ ー タ とは 何 か が お お む ね 理 解 で き る よ う に配 慮 した.第
Ⅰ部 の 記 述 は啓 蒙書 の レベ ル で あ る.
理 論 を よ り正 確 に理 解 した い 方 は,続 ん で い た だ きた い.第
く第 Ⅱ 部(第4∼6章)の
各章 を読み進
Ⅱ 部 も,な るべ く記 述 が 平 易 にな る よ うに心 が け た.第
Ⅱ
部 の 記 述 の レベ ル は,啓 蒙 書 と学 術 論 文 の 中 間 程 度 の レベ ル で あ る.本 書 の 構 成 は 以 下 の とお りで あ る.
第 Ⅰ部 量 子 コ ン ピュ ー タの 初 歩 第 1章 新 た な計 算 モデ ル の 出現 量 子 コ ン ピ ュ ー タの 概 念 が 登 場 し た背 景 や,研 状 な ど に つ い て 述 べ る.さ
究 の 簡 単 な歴 史,研 究 の現
らに,量 子 コ ン ピ ュー タの 動 作 原 理 を直 観 的 に
説 明 す る. 第 2章
量 子 コ ン ピ ュ ー タ と は?
一 般 読 者 向 け の イ ン フ ォー マ ル な 解 説 .量 子 コ ン ピ ュ ー タの 理 論 的 枠 組 み を,で
き るだ け わ か りや す く説 明 す る.Shorの
因 数 分 解 ア ル ゴ リズ ム を直
観 的 に理 解 す る こ と を 目 標 と した. 第 3章 量 子 コ ン ピュ ー タの 実 現 に向 け て 量 子 コ ン ピ ュ ー タの 実 現 に 関 し,主
に物 理 学 者 た ち が 行 っ て い る基 礎 研 究
の現 状 を紹 介 す る.関 連 論 文 が 投 稿 され て い るWWWサ ど も紹 介 す る. 第 Ⅱ 部 量 子 コ ン ピュ ー タの理 論
第 4章 計算論概 説
イ トの ア ド レス な
本 書 の 範 囲 で必 要 と な る,計 算 論 に 関 す る基 本 事 項 を解 説 す る.Turing機 械,ラ
ン ダム ・ア ル ゴ リズ ム,計 算 量 理 論 な どに つ い て,な
るべ く平 易 に説
明 す る. 第 5章 量 子 コ ン ピ ュ ー タの 数 学 的 モ デ ル 量 子Turing機
械 の 定 義 と,そ の性 質 を紹 介 す る.さ
らに,そ の モ デ ル上 で
定 義 さ れ る計 算 量 ク ラ ス につ い て も述 べ る. 第 6章 量 子 ア ル ゴ リズ ム の 設 計 法 最 近,話
題 に な っ て い る,Shorの
因 数 分 解 アル ゴ リズ ム の 詳 細 な 解 説 に 焦
点 を あ て て,量 子 コ ン ピュ ー タ 上 の 効 率 的 ア ル ゴ リズ ム の動 作 に つ い て 説 明 す る. あ とが き 量 子 コ ン ピュ ー タ研 究 の 進 め 方 や,今 後 の 展 望 に つ い て 述 べ る.論 文 や 書 籍 の 購 読 ガ イ ドも掲 載 し た. 文 献 リス ト
量 子 コ ン ピュ ー タの研 究 は,ま だ始 ま った ばか りで あ る.こ の 時 期 に,こ の チ ャ ン ス に あ ふ れ た 分 野 を多 くの 方 々 に知 っ て い た だ き た い と思 い,と 書 を 出版 し よ う と心 が け た.そ の 結 果,多 な っ た の で は な い か と,少
に か く早 く本
少 荒 削 りな もの をお 目 に か け る結 果 に
し気 に な っ て い る.本 書 を 読 んで,1 人 で も多 くの 方
が 量 子 コ ン ピュ ー タ に興 味 を持 っ て 下 され ば,筆 者 に と っ て は望 外 の 喜 びで あ る. 本 書 の 執 筆 に際 し,東 京 電 機 大 学 出版 局 の 植 村 八 潮 氏 に は い ろ い ろ な ご助 言 を い た だ い た.末 筆 な が ら深 く感 謝 申 し上 げ る. 1997年2月 付 記 山 口大 学 理 学 部 の 松 野 浩 嗣 先 生 に は,本 書 の 初 版 の誤 記 誤 植 を 多数 ご指 摘 い た だ い た.3 刷 に あ た っ て 付 記 して 深 く感 謝 申 し上 げ る. 2001年11月
西野哲朗
次
目
は じめ に
i
第 Ⅰ部 第 1章
量 子 コン ピュー タの初歩
新 た な計 算 モ デル の 出現
3
1.1
量 子 コ ン ピ ュ ー タの 定 義
4
1.2
半導体技術 の 限界
5
1.3
量子力 学
6
1.4
Feynmanの
1.5
量 子 コ ン ピ ュ ー タの 数 学 的 モ デ ル の 誕 生
1.6
量 子 コ ン ピ ュ ー タ研 究 の活 発 化
11
1.7
量 子 コ ン ピ ュ ー タへ の 期 待
13
量 子 コ ン ピ ュ ー タ と は?
15
2.1
Turing機
16
2.2
簡 単 な確 率 的Turing機
第 2章
指摘
7 9
械
械
18
2.2.1
記憶 容 量 1 ビ ッ トの 確 率 的Turing機
2.2.2
状 態 ベ ク トル と遷 移行 列
20
2.2.3
状 態の重 ね合 わせ
22
2.2.4
遷 移行列 が満 たす べ き条件
22
2.2.5
計算 木
23
械
18
2.2.6 2.3
2.4
第 3章
計算 木が満 たすべ き条件
簡 単 な 量 子Turing機
26
械
27
2.3.1
記 憶 容 量 1 ビ ッ ト の 量 子Turing機
2.3.2
1QTMの
2.3.3
状態の干 渉
31
2.3.4
計算木が満 たす べ き条件
32
2.3.5
1QTMの
33
Shorの
因数 分 解 ア ル ゴ リズ ム の 動 作 原 理
36
2.4.1
因数 分 解 の 難 し さ
36
2.4.2
量 子Turing機
械 とは
37
2.4.3
離 散Fourier変
換
41
2.4.4
量子並列計 算
2.4.5
2段Fourier変
2.4.6
量 子 k面 サ イ コ ロ投 げ
械
計算木
遷移行列
27 28
44 換
46 50
量 子 コ ン ピュー タの 実現 に向 け て
53
3.1
量子情報
54
3.2
量子 回路
56
3.3
量 子 系 の シ ミュ レ ー シ ョ ン
58
3.4
量 子 コ ン ピュ ー タの 実 現 に お け る問 題 点
60
3.5
研 究の ための情報 源
61
第 Ⅱ部
量子 コン ピュ ー タの理 論
計算論概説
67
4.1
計算 時間の測 り方
68
4.2
計算機 の物理的実現方法 と計算 時間
73
4.3
多 項 式 時 間 ア ル ゴ リズ ム
75
第 4章
4.4
確 率 的 ア ル ゴ リズ ム
77
4.5
P=NP?問
80
4.6
形式言 語
4.7
Turing機
4.8
計算 量の概念
88
4.9
計算 量 の ク ラス と完 全 問題
90
量子 コ ン ピュー タの数 学 的 モデ ル
95
5.1
Turing機
96
5.2
量 子Turing機
第 5章
5.3
第 6章
題
83 85
械
械 の拡張
97
械
97
5.2.1
テ ン ソ ル積
5.2.2
量 子Turing機
械 の 物 理 的表 現
5.2.3
量子Turing機
械の定義
5.2.4
計算過程 と結果の観測
102
5.2.5
万 能 量 子Turing機
104
械
99
100
量 子 計 算 量 の クラ ス
105
量 子 ア ル ゴ リズムの 設計 法
109 110
6.1
DeutschとJozsaの
6.2
因 数 分 解 ア ル ゴ リズ ム の現 状
113
6.3
因数分解 の整数論的基礎
115
6.4
離 散Fourier変
120
6.5
Shorの
ア ル ゴ リズ ム(簡 単 な場 合)
122
6.6
Shorの
ア ル ゴ リ ズ ム(一
125
あ とが き
参考 文献 索 引
ア ル ゴ リズ ム
換
般 の 場 合)
129
136 ・142
第 Ⅰ 部 量 子 コンピュータの初 歩
量 子 コ ン ピ ュ ー タの 初 歩
第 Ⅰ部
量 子Turing機
械 の 理論 を完 全 に理 解 す る こ とは,残 念 なが ら,非 常 に難 しい と
い わ ざ る を得 な い.こ の 理論 は,コ
ン ピュー タ ・サ イエ ンス の 基礎 理 論 で あ る理 論
計 算 機 科 学 と い う学 問 分 野 の最 先 端 の研 究 テ ー マ で あ る.理 論 計 算 機 科 学 の教 育 は,現 在,日
本 の幾 つ か の 大 学 の情 報 系 学 科 で 主 に行 われ てい るが,大
学 生 に理
論 計 算 機 科 学 の基 礎 を完 全 に 身 につ け て も ら う ため に は,や は り最 低 で も2∼3 年 の教 育 を必 要 とす る.一 方,社 の ため に2∼3冊
会 人 の 方 々 の場 合 に は,理 論 計 算 機 科 学 の 習 得
の 標 準 的 な教 科書 を読 む こ とが で きれ ば理 想 的 で あ る.し か し,
何 か と忙 しい この ご時 勢 で は,そ そ こ で,本 書 の 第 2章 は,い
の よ う な時 間 を確 保 す る こ と は非 常 に 難 しい.
ま まで 理 論 計 算 機 科 学 な ど聞 い た こ と もな い とい
う方 々 に も,量 子 コ ン ピュ ー タが どの よ うな動 作 原 理 で動 く機 械 なの か を,直 観 的 に,し か もで き る だけ 正確 に理 解 して い た だ くこ と を目 的 と して 書 い た.筆 者 の 乏 しい力 量 で そ の よ うな こ とが 可 能 と も思 わ れ な い が,本 章 の 記 述 に あ た って は,そ の 方 針 で で き る限 りの 努 力 を試 み た. 一般 読 者 を想 定 した 文 章 の 場 合,数 式 は極 力 書 か な い よ うに す るべ きだ が,量 子 コ ン ピ ュー タの 基 本 原 理 の 説 明 には,簡 単 な 数 式 は導 入 せ ざ る を得 な い.逆 に, 数 式 を使 わ ず にあ え て言 葉 で 説 明 す る と,か え って わ か り に く くな る よ うで あ る. そ こで,第
2章 で は,無 理 数 に関 す る 初 等 的 な計 算,2 行 2列 の 行 列 の 乗 算,級 数
の 和 の公 式,簡 単 な確 率 の 計 算 だ け は用 い る こ と に して記 述 を進 め た.こ 内 容 は お お む ね高 等 学校 で 習 得 す る もの だが,こ
れ らの
れ だ け の 前 提 知 識 で コ ン ピュ ー
タ ・サ イエ ン ス の最 先 端 の 話 題 を ご紹 介 す る わ け なの で,こ れ らの 数 学 的記 述 に つ い て は ど うか ご辛 抱 い た だ きた い .な お,上 記 の 数 学 的 事 項 に 関 して は,必 要 と な る箇 所 に な るべ く公 式 を掲 載 した の で,ご 参 照 い た だ き た い. 数 学 的 な詳 細 は と もか く,量 子 コ ン ピ ュー タが どの よ う な仕 組 み で動 作 す る の か は,第
Ⅰ部 の 内容 か ら だ い たい ご理 解 い た だけ る と思 う.も ち ろ ん,理 論 の詳
細 を完 全 に 理 解 す る こ と は,第
Ⅰ部 の 内容 だ け か らで は無 理 な の で,理
に 理 解 した い 方 は本 書 の 第 Ⅱ 部 を お読 み い ただ きた い.
論 を完 全
第 1章
新 た な計 算 モデ ル の 出現
1994年
に,AT&TBell研
究 所 のP. Shorは,量
子Turing機
数 の 因 数 分 解 を小 さ な 誤 り確 率 で 高 速 に 行 え る こ と を 示 し た.整 き く な る と,ス
の桁 数 が 大
ー パ ー コ ン ピ ュ ー タで さ え も 高 速 に は 行 え な い 作 業 で あ る と考 え ら れ て い る.
も し量 子 コ ン ピ ュ ー タ を 実 際 に 作 る こ とが で き れ ば,Shorの 高 速 に 行 う こ と が で き る.と
こ ろ が,イ
て い る 公 開 鍵 暗 号 系 の 多 くは,現
ア ル ゴ リ ズ ム を用 い て 因 数 分 解 を
ン タ ー ネ ッ ト上 で セ キ ュ リテ ィを 確 保 す る た め に 使 わ れ
在 の コ ン ピ ュ ー タ が100桁
で き な い とい う事 実 に 基 づ い て い る.し ば,多
械 と い う計 算 モ デ ル 上 で,整 数 の 因 数 分 解 は,そ
た が っ て,量
以上 の 因数 を現実 的 時 間 内に は発 見
子 コ ン ピ ュ ー タ の ハ ッ カ ー が も し出 現 す れ
くの 人 々 に 不 安 を 与 え る こ と に な る で あ ろ う.
こ の よ う な 報 道 が な さ れ た た め,米
国 で は量 子 コ ン ピュ ー タが 一 躍 注 目 を 集 め た.と
子 コ ン ピ ュ ー タが ど の よ う な 計 算 機 か と い う こ と は,意 本 章 で は,ま
ず 量 子 コ ン ピ ュ ー タ の 直 観 的 イ メ ー ジ と,量
つ い て 述 べ る.
こ ろ が,量
外 と正 確 に は 知 ら れ て い な い よ うで あ る. 子 コン ピュー タに 関す る研 究 の歴 史 に
1.1
量 子 コ ン ピュー タの定 義
現 在 の コ ン ピ ュ ー タ は,Turing機 (計 算 モ デ ル)に
械(注 1)とい う コ ン ピ ュ ー タ の 数 学 的 モ デ ル
基 づ い て 構 築 さ れ て い る.理
見 す る こ と で あ る.英
国 の 数 学 者Alan
Turingが
コ ン ピ ュ ー タ が 影 も 形 も な か っ た1936年 デ ル で あ るTuring機 物 理 学 者David し た.本
偉 大 だ っ た の は,現
子Turing機
在 の よ うな
ご ろ に ,現 在 の コ ン ピ ュ ー タの 数 学 的 モ
械 を 考 案 し た 点 に あ る.1985年
Deutschは,量
書 で は,量
論 の 重 要 な役 割 の 一 つ は 未 来 を予
子Turing機
に, Turingと
同 じ英 国 人 の
械 とい う新 しい計 算 モ デ ル を提 案
械 をモ デ ル とす る コ ン ピ ュー タの こ と を量 子 コ
ン ピ ュ ー タ と 呼 ぶ.
本 書 の 目的 は,最 近 話 題 に な って い る この 量 子 コ ン ピュ ー タの 理 論 的 枠 組 み を, な るべ く多 くの 読 者 に正 確 に 理 解 して い た だ くこ とで あ る.本 書 を お 読 み い た だ け れ ば わ か る が,量 子 コ ン ピュ ー タは まだ 実 現 され て い な い し,ま た,近 い 将 来 に実 用 に な る と もあ ま り考 え られ て い な い.現 在 ま で に量 子 コ ン ピ ュ ー タ につ い て 研 究 され て い る の は,そ の ほ とん どが,実 す る こ と で は な く,量 子Turing機
際 の 量 子 コ ン ピュ ー タの 設 計 法 に関
械 と い う計 算 モ デ ル の性 質 と,そ の モ デ ル 上
の 効 率 的 な ア ル ゴ リズ ム(問 題 の 解 法 手 続 き)の 設計 手 法 なの で あ る .本 書 で は, 量 子 コ ン ピュ ー タ の実 現 可 能性 につ い て も若 干 記 述 す るが,本 書 の 目的 は,あ
く
ま で, 量子Turing機
械 とい う ま っ た く新 しい 計 算 モ デ ル の 根底 にあ る考 え
方 を,理 論 計 算 機 科 学(注2)の 立 場 か ら解 説 す る こ と で あ る.あ わ せ て,量 子Turing機
械 上 に お け る,(理 論 上)効
率的 なアル ゴ
リズ ム の 設 計 法 に つ い て も紹 介 す る. 量 子 コ ン ピ ュー タ に関 す る研 究 は,ま だ 始 ま った ば か りで あ る.ご
く最 近 に なっ
て,量 子 コ ン ピ ュ ー タの 実現 に関 す る研 究 も盛 ん に な っ て きた し,理 論研 究 も加 速度 的 に件 数 が 増 え て い る の で,こ の 分 野 の 今 後 の進 展 に はお お い に 期待 で きる (注 1)Turing機 (注 2)
械 につ い て は
第 4章 参照.
,本
書 の 第 2 章 と 第 4 章 で 詳 し く述 べ る.
で あ ろ う.本 書 を読 ま れ た 多 くの 方 々が,そ
の よ うな研 究 の 本 質 的 な 意 味 を正 確
に理 解 で き る よ うに な っ て い た だ け れ ば幸 い で あ る.ま た,量 子 コ ン ピ ュ ー タの 理 論 や 実 現 に 関 す る研 究 に進 み た い 方 は,そ の た め に必 要 な 基 礎 知 識 が 本 書 か ら 得 られ る は ず で あ る.
1.2
半導体技術 の限界
まず 最 初 に,量 子 コ ン ピ ュ ー タが提 案 され るに 至 っ た歴 史 的 背 景 を 簡 単 に述 べ て お く.コ ン ピュ ー タの誕 生 か ら今 日ま で の約50年
間,平 均 して 考 え れ ば,コ
ン
ピ ュ ー タ は 2年 ご と に そ の計 算 速 度 が 2倍 に 高 速 化 さ れ,し か も,そ の サ イ ズ は 半 分 に縮 小 化 さ れ て きた.50年
前,大 部 屋 を独 占 して い た初 期 の コ ン ピ ュ ー タ よ
り も,現 在 の パ ソ コ ンの 方 が 大 きな計 算 能 力 を持 って い る.し か し,こ の よ うな 急 速 な 進 歩 は つ い に終 わ り を告 げ,集 積 回 路 技 術 は そ の 限 界 に 直 面 して い る と い わ れ て い る. 現 在 の 集 積 回 路 は,人 で きて い る.さ
間 の 髪 の 毛 の 幅 よ り もは るか に小 さな トラ ン ジ ス タか ら
らに,最 先 端 の技 術 を用 い る と,現 在 の もの よ り も100倍
も小 さ
な ト ラ ン ジ ス タ を生 産 す る こ とが で き るそ うで あ る.し か し,そ の よ うな ミク ロ の 世 界 で は,個 々 の 原 子 が 姿 を現 す た め,現 在 の 理 論 に基 づ く集積 回 路 は 機 能 し な くな る とい わ れ て い る.し た が っ て,将 来 コ ン ピュ ー タ を ミク ロ化 した け れ ば, ま っ た く新 しい 理論 に基 づ く新 技 術 が 必 要 とな る. そ も そ も,コ ま た,コ
ン ピ ュ ー タ を 構 成 す る 回 路 は ど こ ま で 小 さ くで き る の だ ろ う か?
ン ピ ュ ー タ の 計 算 過 程 に お い て,最
消 費 さ れ ね ば な ら な い の だ ろ う か?
低 限 どの くら いの 量 の エ ネ ル ギ ーが
コ ン ピ ュ ー タ を ミ ク ロ 化 す る た め に は,こ
の よ う な 物 理 的 限 界 を 明 ら か に し て お か な け れ ば な ら な い.コ 化 に 関 す る こ の よ う な 問 題 に 答 え る た め に,IBMト 2人 の 先 駆 的 研 究 者Rolf LandauerとCharles
ー マ スJ.ワ H. Bennettは,計
ン ピ ュ ー タの 小 型 ト ソ ン研 究 所 の 算 の物理 学 に
つ い て の 研 究 を 数 十 年 前 か ら 今 日 に 至 る ま で 続 け て い る[9,30].
コ ン ピ ュ ー タは物 理 的 装 置 で あ るか ら,そ の 動 作 や性 質 は物 理 学 の 言 葉 で 記 述
す る こ とが で き る.こ の と き,コ
ン ピ ュー タが 非 常 に小 さ くな れ ば,そ
の動 作 の
記 述 は古 典 力 学 で は な く,量 子 力学 に よ って 与 え な け れ ば現 実 に そ ぐわ な くな る. 実 際,電
子 や 原 子 な どの ミク ロ な物 理 系 の 振 る舞 い は,古 典 力 学 で は 正 確 に表 現
で きな い が,量 子 力 学 を 用 い て 表 現 す る と実 験 事 実 を うま く説 明 で きる.し か し, 量 子 力 学 的 世 界 を支 配 す る確 率 法 則 は,マ
ク ロ な 世 界 に住 ん で い る 私 た ち人 間の
直 観 に は 反す る もの で あ る.こ の確 率 法 則 の違 い の た め に,量 子 力 学 的現 象 は,私 た ちが 慣 れ 親 し んで い る 古 典 力 学 的 現 象 とは ま っ た く異 な っ て い る.
1.3 量 子 力学 量 子 力 学 の 理 論 は,デ
ンマ ー ク の物 理 学 者Niels Bohrら
よ く知 られ て い る よ うに,我
に よ って 構 築 され た.
々の 直観 に反 す る よ うな 多 くの 実 験 結 果 が,量 子 力
学 を用 い て説 明 した り,予 想 す る こ とが で きた.量 子 コ ン ピ ュ ー タの動 作 を正 し く理 解 す るた め に は,波 動 と粒 子 の 二 重 性 と呼 ば れ る 量 子 力 学 にお け る一 つ の 事 実 を理 解 して お け ば よい.波 動 と粒 子 の 二 重 性 は,非 常 に 大 雑 把 に い え ば,以 下 の こ とを 述 べ て い る. 原 子 の よ うな,我 々が 粒 子 と考 え て い る もの が,あ 波 の よ うに振 る 舞 い,逆 に,光 の よ うな,我 が,時
る環 境 の も とで は
々が 波 と考 えて い る もの
と し て粒 子 の よ う に振 る舞 う.
量 子 力 学 の 理 論 は,ど
の よ うな 波 に 対 して,ど の よ うな 粒 子 が 対 応 す るか につ
い て 述 べ て い る と考 え る こ とが で き る. 波 動 と粒 子 の 二 重 性 か ら導 か れ る 第一 の 帰 結 は,原 子 の よ うな小 さな物 理系 は, 離 散 的 な エ ネ ル ギ ー 状態 の み を取 り得 る とい うこ とで あ る.原 子 が あ る エ ネ ル ギー 状 態 か ら他 の エ ネ ル ギ ー状 態 に移 る と きに は,光 子 と呼 ばれ る一 定量 のエ ネ ルギ ー の か た ま り を吸 収 また は 放 出 す る.こ の 光 子 は,光 い る.
を構 成 す る粒 子 と考 え られ て
波 動 と粒 子 の 二 重 性 か らの 第二 の 帰 結 は,量 子 力 学 的 波 は水 面 の 波 の よ うに 重 ね 合 わ せ る(加
え合 わせ る)こ
とが で き る とい う こ とで あ る.こ の 場 合,重
ね合
わ さ れ る個 々の 波 は,あ る一 つ の 粒 子 の位 置 をお お まか に記 述 して い る.し か し, この よ う な波 が 二 つ 以 上 重 ね 合 わ され る と,各 粒 子 の 位 置 は不 確 か に な る.量 子 力 学 に お い て は,一 つ の粒 子 が 二 つ の位 置 に同 時 に存 在 す る と考 え る こ とが あ る. この よ う な粒 子 の位 置 は,例
え ば,光 子 が 電子 か ら飛 び 出す とい う よ うな,あ
る
種 の 相 互 作 用 に よ って,そ の粒 子 が ど ち らの位 置 に 存 在 す るか が 判 明 す る まで は, わ か らな い ま ま で あ る. 二 つ の 重 ね 合 わ され た 量 子 波 は,そ れ らが 一 つ の 波 の よ うに振 る 舞 う と き,コ ヒ ー レ ン トで あ る とい わ れ る.一 方,二 つ の コ ヒ ー レ ン トな 波 が,そ れ ぞ れ の 独 自性 を 回復 す る過 程 を,デ
コ ヒ ー レ ン ス とい う.一 般 にデ コ ヒ ー レ ンス に は,長
い 時 間 が か か る可 能性 が あ る.例 え ば,光 子 が 電 子 に衝 突 す る こ と に よ り,そ の 真 の 位 置 を明 ら か に す る まで に は,数
日 を 要す る 場 合 もあ る.原 理 的 に は,野 球
の ボ ー ル も二 つ の 位 置 に 同 時 に存 在 し得 るが,実 確 な 位 置 が す ぐ に検 出 で きて しま うた め に,そ 性 を持 つ の は,ミ
際 に は,ボ ー ル は 大 き過 ぎて 正 うは な らな い.波 動 と粒 子 の 二 重
ク ロ サ イズ の も の の み で あ る.
量 子 力 学 につ い て の 教 科 書 や 啓 蒙書 は 多 数 出版 され て い る が,情 報 分 野 の研 究 者 に 理 解 しや す い もの と して は,[32,41,44,45,50]な
1.4
Feynmanの an
一般 に
どが あ る.
の指 摘
,汎 用 コ ン ピュ ー タは 以 下 の 条件 を満 たす よ うな万 能 計 算 装 置 で あ る こ
とが 理 想 で あ る. 汎 用 コ ン ピ ュ ー タ は,任 意 の 物 理 的 計 算 装 置 を効 率 よ く シ ミュ レー シ ョ ン(模
倣)す
る こ と が で き る.
こ こで,「効 率 よ く」 とい うの は,「た か だ か 多 項 式 倍 の計 算 時 間 で 」 とい う意 味 で あ る.つ ま り,任 意 の 計 算装 置 M を考 え,M
が サ イズ n の 入 力 に対 して,た か
だ かt(n)ス
テ ッ プ 以 内 に 計 算 を 終 了 す る と す れ ば,汎
と 同 じ計 算 を(t(n))κ
ス テ ッ プ 以 内 に 行 わ な け れ ば な ら な い(た
従 来 の 計 算 論 に お い て は,こ て い た.例
え ば,万
意 のTuring機
用 コンピュー タ U はそれ だ し κ は 定 数) .
の よ うな 汎 用 コ ン ピ ュ ー タの 数 学 的 モ デ ル が 存 在 し
能Turing機
械[27]と
い う 汎 用 コ ン ピ ュ ー タ の モ デ ル は,任
械 を 効 率 よ く模 倣 で き る こ と が 知 ら れ て い る.
と こ ろ で,通 常 のTuring機
械 は,計 算 の 各 ス テ ップ や,テ ー プ へ の 情 報 の 書 き
込 み ・読 み 出 しが確 定 的 に行 わ れ るか ら,そ の 意 味 で は古 典 力 学 で 記 述 で き るモ デ ル で あ る.そ
こで,量 子 力 学 を考 慮 に 入 れ て も,上 の 命 題 が 同 様 に成 り立 つ か
とい う疑 問 が 生 じ る. 量 子 力 学 的 動 作 原 理 が 計 算 に どの よ うな影 響 を及 ぼ す か を 最初 に 問 題 に した の は,Richard P. Feynmanで
あ った[20 ,21].彼 は,古 典 的 な ノ イマ ン型 コ ン ピュー
タ を用 い て量 子 系 を シ ミュ レ ー シ ョ ンす る と,上 で 述 べ た確 率 法 則 の 違 い の ため に,非 常 に 多 くの 計 算 時 間 が必 要 と な る可 能 性 が あ る こ とを指 摘 した.彼 は また, この 問 題 を回 避 す る た め に,量 子 力 学 的 原 理 に基 づ くコ ン ピ ュ ー タが 利 用 で き る 可 能性 につ い て も述 べ た.つ ま り彼 は,量 子 コ ン ピ ュー タが(未 知 の 物 質 を も含 め た)量 子 系 の シ ミュ レー シ ョン に役 立 つ か も しれ な い とい う こ と を指 摘 した の だ . 見 方 を変 え れ ば,彼
は暗 に次 の よ うな問 題 を提 示 した と考 え る こ と もで きる.
量 子 力 学 的 動 作 原 理 に 基 づ くコ ン ピ ュー タは,古 典 的 コ ン ピ ュ ー タよ り も効 率 的 に計 算 が 行 え るか? この 問 題 につ い て は,第
4章 以 降 で 詳 し く述 べ る.
アル ゴ ンヌ 国 立 研 究所 のPaul Benioffは,通 学 を用 い て 表現 で きる こ とを,1980年
常 の コ ン ピュ ー タの 動 作 が 量 子 力
代 初 め に示 した[8].具 体 的 にはBenioffは,
量 子 力 学 の 最 も基 本 的 な枠 組 み で あ る量 子 過 程 の 可 逆 ユ ニ タ リ発 展 に よ っ て,通 常 のTuring機
械 が模 倣 で き る こ と を示 した.し か し,彼 は 量 子 力 学 的 動 作 原 理 を
用 い る こ と で,よ
り大 きな計 算 能 力 が 得 られ るか 否 か に つ い て は考 察 し なか った.
1.5
量子 コ ン ピュー タの数 学 的 モデ ルの誕 生
最 近 話 題 に な って い る量 子 コ ン ピ ュー タの 明確 な数 学 的 モ デ ル を最 初 に 与 えた の は,Oxford大
学 数 理 研 究 所 の物 理 学 者David Deutschで
量 子 コ ン ピ ュ ー タの 数 学 的 モ デ ル で あ る量 子Turing機 そ れ らの数 学 的 性 質 を研 究 した.そ
あ る[15,16].彼
は,
械 と量 子 回 路 を定 義 し,
して,そ れ らの モ デ ルが 現 在 の コ ン ピュー タの
数 学 的 モ デ ル とどの よ うに違 うの か を発 見 し よ う と試 み た.特 に彼 は,コ ン ピュー タの 計 算 速 度 を飛 躍 的 に向 上 させ るの に,量 子 力 学 的 効 果 が 利 用 で きる の で は な い か と考 え た. こ こ で,量 f(x)の
子 コ ン ピ ュ ー タ の 直 観 的 イ メ ー ジ を 述 べ て お こ う.例
値 を コ ン ピ ュ ー タ に 計 算 させ る こ と を 考 え る.た
る 値 は,x1,x2,…,x7の
7通 り の み と す る.い
対 し て,f(xi)=aと 現 在 の(逐
ン ピ ュ ー タ を 用 い て,こ
7 台 の コ ン ピ ュ ー タ を 用 意 し て,そ
数 x が 取 り得
る 入 力xi(1〓2〓7)に
の 問 題 を な る べ く速 く解 く に は,
れ ら を 並 列 に 動 作 さ せ れ ば よ い.7
台 の コン
値 を計 算 す る た め の 同 じ プ ロ グ ラ ム に 従 っ て 動 作 す る が,7
へ の 入 力 は す べ て 違 え て お く.こ 1.1(a)参
数
な る こ と が あ る か ど う か を 知 り た い と し よ う(注 1).
次 型)コ
ピ ュ ー タ はf(x)の
ま,あ
だ し,変
と し て,関
の よ う な 処 理 がtn時
台
間 で 行 え る と し よ う(図
照).
こ れ と 同 じ作業 を,量 子 コ ン ピ ュ ー タな らば た っ た 1台 で,し か も 同 じ計 算 時 間tnで
行 え る.ま ず,量 子 コ ン ピュ ー タに お い て は,通 常 の 7台 の コ ン ピ ュー タ
そ れ ぞ れ の 計 算 過 程 が,あ
る波 と して表 現 され る(図1.1(b)参
照).こ
れ らの 波
の 波 長 や 振 幅 は,計 算 結 果 が 違 え ば異 な っ て い る もの とす る.ま た,同
じ計 算 結
果 に 対 応 す る波 で も,位 相 が異 な って い る こ と もあ る.例
え ば,図(b)中
の出力
が bの 場 合 に 対 応 す る太 線 の二 つ の波 と,出 力 が cの 場 合 に対 応 す る点 線 の 二 つ の 波 は,そ れ ぞ れ位 相 が 逆 に な っ て い る. 量 子 コ ン ピ ュ ー タ で は,通
常 の 7台 の コ ン ピ ュ ー タが 別 々 に 行 う計 算 を,上
で述
べ た 7個 の 波 を 一 つ に 重 ね 合 わ せ て し ま う こ と に よ り,1 台 で 行 う こ と が で き る. (注1)ここ で 7 とい う数 字 は本 質 的で は ない .こ こ での 議論 は,人 力 が 何 通 りの場 合 で も成 り 立つ.
(a)
(b)
(c)
図1.1
量 子 コ ン ピュー タの概 念 図.(a)通 常 の 並列計 算 の過 程,(b)各 計算 過 程 の波 に よる表現 ,( c)重ね 合 わ され た波.
しか も,こ の よ うに 波 を重 ね合 わせ た と きに,位 相 の異 な る 波(図1.1(b)の の 波 や 点 線 の 波)は
太線
打 ち消 し合 っ て 消 え て しま う(負 の 干 渉) .一 方,図1.1(b)
の 実 線 の 波 の よ うな,波 長 の 同 じ波 同士 は 強 め 合 う(正 の 干 渉) . 量 子 コ ン ピ ュ ー タ にお け る計 算 で は,所 望 の 結 果(図 過 程 が お互 い に強 め 合 い,そ きれ ば,計 算 終 了 後(図
の 例 で は a)を 出 す 計 算
の 他 の 計 算 過 程 は逆 に弱 め合 う よ うにす る こ とが で
の 時 刻tn)に
出 力 を観 測 した と きに,高 い確 率 で 所 望 の
結 果 を読 み 出せ る.例 え ば,図1.1(c)に
お い て は,実 線 の波 同 士 は強 め合 っ て い
る の に対 し,太 線 の波 と点 線 の 波 は打 ち消 し合 っ て消 え て し まっ て い る.し た が っ て,時 刻tnに
出 力 結 果a(実
と結 果 c(点 線 の波)を
線 の 波)を 読 み 出 す 確 率 は 1,結 果 b(太 線 の波)
読 み 出 す 確 率 は と も に 0 とな る.
量子 コ ン ピュ ー タ研 究 の活 発 化
1.6
実 は,1980年 代 後 半 に,量 子 コ ン ピュ ー タの研 究 は 一 時 衰 え を見せ た.そ の 第 一の原因は ,こ の 分野 の研 究 者 が すべ て,量 子 コ ン ピュー タの 理 論 的 考 察 の み を行 い,そ
れ を実 現 す る た め の 物 理 的 研 究 を行 わ なか っ た こ とで あ る .こ の ア プ ロ ー
チ をIBMのLandauerは
特 に厳 し く批 判 した.ま た,量 子 コ ン ピ ュー タは エ ラー
を起 こ しや す く,誤 り訂 正 が 深 刻 な 問 題 に な る こ と も明 らか に な って きた.と ろ が,何
こ
か 具 体 的 な 数 学 的 問 題 を,量 子 コ ン ピュ ー タが現 在 の コ ン ピ ュー タ よ り
も実 際 に速 く解 け る か 否 か は 不 明 の ま ま で あ った. と こ ろ が,こ
の 数 年 間 で 事 態 は 一 変 し た.1994年
にAT&T,
Bell研
究所 の
Peter W. Shorが,
量 子Turing機
械 を用 い る と,因 数 分 解 問 題 と離 散 対 数 問 題 が非 常 に
小さな 誤 り確 率 で 高 速 に 解 け る こ と を示 し,大 き なブ レ ー クス ル ー を もた ら した.こ こで,因 数 分 解 問 題 とは ,「整 数 N が 与 え られ た と き に,N
の 非 自明 な(つ
ま り 1と N 以 外 の)因 数 が 存 在
す る な らば,そ れ を 1組 発 見 せ よ 」 とい う問 題 で あ る.ま た,離 散 対 数 問 題 とは, 「素 数 p,整 数 g と整 数 x(mod p)が 与 え られ た と きに,gr=x(mod
p)と な
る整 数 γ を発 見 せ よ」 とい う問 題 で あ る.整 数 N の 因数 分 解 は,N
が比 較 的小
さ な数 の 場 合 に は,現 在 の コ ン ピ ュ ー タで も十 分 実 用 的 な時 間 内 に行 え る が,N が 大 き くな る に従 っ て膨 大 な計 算 時 間 が 必 要 とな り,現 在 最 も強 力 な ス ーパ ー コ ン ピ ュ ー タ を用 い て も行 え な くな る.同 様 に 離 散 対 数 問題 も,一 般 に,現 在 の コ ン ピ ュ ー タで は 効 率 よ く解 くこ と はで きな い と考 え ら れ て い る .効 率 的 な量 子 ア
ル ゴ リズ ム の 設 計 法 につ い て は,第 Shorの
この 結 果 は,1994年
6章 で詳 し く述 べ る.
に ア メ リカ で 大 反 響 を巻 き起 こ した.と
現 在 提 案 され て い るRSAな
い うの は,
どの 公 開 鍵 暗 号 系 の 代 表 的 な もの が,因 数 分解 問 題
と離 散 対 数 問題 の 難 し さ を前 提 と して 設 計 され て い る か らで あ る.つ
ま り,大 き
な 整 数 の 因数 分 解 の 難 し さが,暗 号 解 読 の 難 し さに 対 応 す る よ うに 暗 号 系 が 設 計 さ れ て い る の だ.公 開 鍵 暗号 は,こ れ か らの イ ン ター ネ ッ ト社 会 に お い て,情 報 セ キ ュ リテ ィの 要 に な る と考 え られ て い る.し た が って,も が 実 現 で きて しま うと,Shorの
し量 子 コ ン ピュ ー タ
ア ル ゴ リ ズム を用 い て,因 数 分 解 や 離 散 対 数 に基
づ い た 公 開鍵 暗 号 を高 い 確 率 で 破 れ る こ とに な り,大 きな 社 会 不 安 が もた ら され る可 能性 が あ る.し か し,現 在 ま で の研 究 成 果 か ら判 断 す る と,近 い 将 来 に そ の よ うな 社 会 不 安 が起 こ る可 能 性 は ほ とん ど な さそ うで あ る.実 は そ の く らい,量 子 コ ン ピ ュ ー タの 実 現 は難 しそ うな の で あ る. 上 で 述 べ たShorの だが,こ
結 果 は,量 子Turing機
こ で 注 意 す べ き こ とは,Shor自
で あ る.す な わ ち,最 初 はDeutschら 機 械 の 計 算 能 力 が,1990年
械 の計 算 能 力 を数 学 的 に示 した もの
身 は理 論 計 算 機 科 学 者 で あ る とい う こ と の 物 理 学 者 に よ って提 案 され た 量 子Turing
ご ろ か ら計 算 機 科 学 者 に よっ て も研 究 さ れ る よ う に
な っ たの だ.詳 しい こ とは後 の章 で紹 介 す る が,Shorの とVazirani, Yao, Simonら
結 果 以 外 に も, Bernstein
の 理 論 計 算 機 科 学 者 が 優 れ た計 算 論 的研 究 成 果 を発 表
し,量 子 コ ン ピ ュー タの 計 算 論 的 基礎 を築 き上 げ た.本 書 の 目的 は,Shorの
因数
分 解 ア ル ゴ リズ ム の 解 説 を中 心 に,量 子 コ ン ピュ ー タ研 究 の計 算 論 的 基 礎 を解 説 す る こ とで あ る. ま た 最 近 に な っ て,量
子 コ ン ピ ュ ー タ の 物 理 的 実 現 方 法 に つ い て も,幾
究 成 果 が 発 表 さ れ 始 め た.1993年
にMITのSeth
し て 動 作 す る 可 能 性 が あ る 物 理 系 の 候 補 と し て,多 挙 し た.そ ま た,カ
れ ら の 物 理 系 は,Landauerの リ フ ォル ニ ア 工 科 大 学 のH.Jeff
Institute of Standards ど が,量
Lloydは,量
つ か の研
子 コ ン ピュ ー タ と
くの よ く知 ら れ た 物 理 系 を 列
反 論 の 幾 つ か を 回 避 す る 形 で 動 作 す る. Kimbleの
and Technology)のDavid
グ ル ー プ や, NIST(National J. Winelandの
グ ループ な
子 コ ン ピ ュ ー タ の 実 現 方 式 に 関 す る 基 礎 実 験 を 行 っ て い る.さ
ら に,量
子 コ ン ピ ュー タの誤 り訂 正 に 関 す る理 論 的成 果 も,ご
く最 近 に な っ て活 発 に発 表
さ れ始 め た.
1.7
量 子 コ ン ピュ ー タへ の期待
い ま ま で に,多
くの 計 算 機 科 学 者,物
デ ル で あ る 量 子Turing機
理 学 者 が,量 子 コ ン ピ ュ ー タの 数 学 的 モ
械 の 計 算 論 的 性 質 を明 らか に し て きた.理 論 上 は,量
子 コ ン ピ ュ ー タに は 以 下 の 三 つ の こ とが 期 待 で き る. 1.任 意 の 物 理 系 の 効 率 的 な シ ミ ュ レ ー シ ョ ン
BernsteinとVazirani[10],お 機 械 は,任
よ びYao[54]の
結 果 か ら, Deutschの
量 子Turing
意 の 物 理 系 を 効 率 的 に 模 倣 で き る こ と が わ か っ て い る.
2.発 熱 量 の 極 め て 少 な い コ ン ピュ ー タ の 実 現 計 算 過 程 を一 意 的 に逆 戻 りで き る計 算 シ ステ ムの こ とを,可 逆 的 計 算 シ ス テ ム とい う[40].量 子Turing機
械 は,定 義 か らた だ ちに可 逆 的計 算 シス テ ム で あ る こ
と が わ か る.一 般 に,可 逆 的計 算 シス テ ム をモ デ ル とす る コ ン ピ ュ ー タに お い て は,発
熱 量 を非 常 に 少 な くで き る との 指 摘 が あ る[9,40] .
一 般 に,通
常 のTuring機
の 手 法[9]を
用 い る と,任
行 う可 逆Turing機
械 は 可 逆 で は な い.し 意 の(決
械 M'に
械 M
変 換 す る こ と が で き る.し
機 械 を モ デ ル と す る コ ン ピ ュ ー タ も,Bennettの 論 的 に は 発 熱 量 を 少 な く す る こ と が で き る.し ら れ たTuring機 と し,ま
械 M'は,も
と のTuring機
た 計 算 速 度 も 若 干 低 下 す る.一
ン ピ ュ ー タ は,そ
方,量
は ,そ
示 した 可 逆 化 れ と 同 じ計 算 を
た が っ て,通
常 のTuring
手 法 を 用 い て 可 逆 化 す れ ば,理 か し,Bennettの 械 M
手 法 に 従 っ て得
よ り も多 く の 記 憶 領 域 を 必 要
子Turing機
の 定義 か ら も と も と可 逆 な の で
化 す る 必 要 が な い.
か し, Bennettが
定 性)Turing機
,Bennettの
械 をモ デ ル とす る コ 手 法 を用 い て 可 逆
3.計 算 時 間の飛 躍 的短縮 Shorの
ア ル ゴ リズ ム[48]を 用 い れ ば,量 子Turing機
誤 り確 率 で高 速 に行 え る.通 常 のTuring機
械 上 で 因数 分解 を小 さな
械 上 で は,同 様 な こ と は行 え ない で あ
ろ うと予 想 され て い る ので(た だ し証 明 は され て い ない!),お 機 械 は 通 常 のTuring機
械 よ り も,(因 数 分 解 の よ う な)あ る種 の 計 算 は 高 速 に実
行 で きる で あ ろ うと予 想 され る.た だ し,量 子Turing機 題 が 効 率 的 に解 け るか 否 か は まだ わか っ て お らず,た な っ て い る(NP完
全 問題 に つ い て は,第
械 を用 い て, NP完
全問
いへ ん重 要 な未 解 決 問 題 と
4章 参 照).
現 在 の コ ン ピ ュー タの数 学 的 モデ ル はTuring機 りに 異 な る の で,こ
そ ら く量 子Turing
械 で あ るが,両 者 の構 造 は あ ま
の こ と をす ぐ に は納 得 で きな い 方 も多 い だ ろ う.現 在 の 我 々
で す ら そ の よ うな状 況 な の だ か ら,Turing機
械 が 考 案 さ れ た1936年
当時 の人 々
に は,現 在 の コ ン ピュ ー タの 実 現 形 態 は ま っ た く想 像 で き なか っ た で あ ろ う.そ れ と同 じよ うに,量 子Turing機
械 が 考 案 さ れ て まだ 間 もな い現 在 の我 々 に は,も
し量 子 コ ン ピ ュ ー タが 未 来 に実 現 され る と して も,そ の姿 が想 像 で き な い の は し ご く当然 の こ とで あ る. 本 書 を読 ん で,も
し量 子Turing機
械 に興 味 を持 た れ た ら,そ れ に基 づ く量 子
コ ン ピ ュー タの 物 理 的 実 現 方 法 や,量 子 コ ン ピ ュ ー タ上 の 効 率 的 ア ル ゴ リ ズ ムの 設 計 手 法,さ
ら には 量 子 コ ン ピュ ー タの プ ロ グ ラ ミング 方 法 論 な どに つ い て,ぜ
ひ,思 い を はせ て い た だ きた い.世 界 初 の 量 子 コ ン ピ ュー タが 日本 で 開 発 され た ら どん な に 素 晴 ら しい こ とで あ ろ うか.
第 2章 量 子 コ ン ピ ュ ー タ と は?
前章 で述 べ た とお り,量 子 コ ンピュ ー タの数 学的 モデ ル は量 子Turing機 械で あ る.本 書 の 目標 の一 つは,こ の量子Turing機 械 を用 い る と,整 数の 因数 分解 が少 ない 誤 り確率 で高 速 に行 え る と い うShorの 結 果 を紹 介 する こ とであ る.し か し,こ の事実 を数学 的 に完全 に理 解 す るこ とは ,理 論 計 算機 科 学 に初 めて接 す る読者 に とっては,非 常 にたい へ んな作 業 とな るであ ろ う.そ こで,本 章 で は,量 子Turing機
械が 高速 に因数 分 解 を行 う際 の動作 を,直 観 的 に理 解 してい た だ こ うと思
う.第 6章 で,こ の動作 を数 学 的 に厳密 に説 明 す るが,数 学 的 な詳細 に興味 の な い読 者 は,こ の 章 の 説 明 を理 解 して い ただ くだけ で も十分 だ と思 う. さ っ そ く計 算 モ デ ル の 説 明 を 始 め る が,以 て,徐 →
記 憶 容 量 1 ビ ッ トの 確 率 的Turing機
械(1QTM)→
一 般 の 量 子Turing機
的Turing機
る べ く簡 単 な 計 算 モ デ ル の 説 明 か ら 始 め
に,1QTMが
械(1PTM)→
体 的 に は,Turing機
械(QTM)のUG順
番 に 説 明 し て い く.Turing機
械 が 得 ら れ る.1QTMは,1PTMを 理 解 で きれ ば,そ
つ い て は,本
械 と確 率
械 を拡 張 す る こ と に よ り確
少 し拡 張 す る だ け で 得 る こ と が で き る.さ
れ を 一 般 化 してQTMを
章 の 最 後 で 説 明 す る.
械(TM)
記 憶 容 量 1 ビ ッ トの 量 子Turing機
械 は 古 く か ら知 ら れ て い る計 算 モ デ ル で あ り, Turing機
率 的Turing機
QTMに
下 で は,な
々 に複 雑 な モ デ ル の 説 明 に 移 る よ う に話 を 進 め て い く.具
理 解 す る こ と は,そ
ら
れ ほ ど 難 し くな い.
2.1
Turing機
ま ず 最 初 に,簡 を 図2.1に
機械
単 なTuring機
示 す(注1).図2.1か
央 処 理 装 置(CPU)と,テ れ て お り,有
械(Turing
下TMと
略 す)の
例
有 限 制 御 部 と呼 ば れ る 中
ー プ か ら な っ て い る.有
限 制 御 部 に は ヘ ッ ド が接 続 さ
限 制 御 部 は ヘ ッドが そ の 時 点 で 位 置 して い る テ ー プ の マ ス 目 に書 か
れ た 記 号 を 読 む こ と が で き る.テ よ い が,本
Machine,以
ら わ か る よ う に,TMは
ー プ の マ ス 目 に 書 く記 号 は ど の よ う に 定 め て も
書 で は テ ー プ の 1マ ス に 記 入 で き る の は,0
記 号 の み と す る.テ
ま た は 1 と い う 2種 類 の
ー プ 記 号 を こ の よ う に 制 限 し て も,一
般 性 を 失 わ な い こ とが
知 ら れ て い る.
有 限 制 御 部 は,そ の 名 の とお り,各 時点 に お い て有 限 個 の 状 態 の う ちの ど れ か 一 つ の 状 態 に あ る .TMの はTMの
動 作 は,状
態 遷 移 関 数 で 定 義 され る.状 態 遷 移 関数
プ ロ グ ラム と考 え る こ とが で き,図2.2の
よ うな 表 形 式 で 表 す こ とが で
き る. 図2.1の
よ うな構 造 を持 ち,図2.2の
M と呼 ぼ う.M 立 っ て,M
よ う に状 態 遷 移 関 数 を定 義 され たTMを
は以 下 の よ うに動 作 す る(図2.3参
照).ま
に は 入 力 が テ ー プ 上 に与 え られ る.図2.3の
100が 与 え られ て い る.起 動 前 に は,M
ず,動 作 の 開始 に先
場 合 に は,入 力 と して
の 有 限 制御 部 は 開始 状 態q0に
れ て お り,ヘ ッ ドは テ ー プ の 左 端 の 記 号(図2.3の
セ ットさ
場 合 に は 1)を 読 ん で い る.こ
の と き,起 動 後 の M の 動 作 は以 下 の よ うに な る. 最 初,M
の 「現 在 の 状 態 」 はq0で,ヘ
な の で,図2.2の
ッ ドが 読 んで い る 「現 在 の 記 号 」 は 1
状 態 遷 移 関 数 の 定 義 の 1行 目 が適 用 さ れ る.そ の 結 果,M
態 を 「次 の 状 態 」 で あ るq1に
遷 移 させ,ヘ
は状
ッ ドが 位 置 して い る 1マ ス 目 に 「書
き込 む記 号 」 で あ る 0を 上書 き し,「ヘ ッ ドの 移 動 方 向 」 で あ る R(右 側)に ヘ ッ ド を 1マ ス 移 動 させ る.な お,ヘ 側)が
ッ ドの 移動 方 向 と して は,L(左
側)と
R(右
指 定 で き る.
(注1)本節 で単 にTuring機 る.
械 と呼 ん でい るの は ,通 常,決 定性Turing機
械 と呼 ば れてい る計 算 モデ ルで あ
図2.1
Turing機
械 M
図2.2
上 の 遷 移 に よ り,M
の
図2.3 TMMの
動作
M の状 態遷 移 関数 の 表
「現 在 の 状 態 」 はq1,ヘ
ッ ドが 読 ん で い る 「現 在 の 記
号 」 は 0 に な っ た の で,今
度 は,図2.2の
状 態 をq2に
ッ ドが 位 置 し て い る 2 マ ス 目 に 1 を 上 書 き し,ヘ
遷 移 させ,ヘ
2行 目 が 適 用 さ れ る.そ
の 結 果,M
は ッド
を 1 マ ス 右 に 移 動 さ せ る.
以 下 同様 に して,M
の 遷 移 は 進 む が,も
しあ る時 点 で, M の 「現 在 の 状 態 」
と 「現 在 の 記 号 」 の組 に対 して,状 態 遷 移 が 定義 され て い な い よ うな状 況 に到 達 した ら,そ の 時 点 で M は停 止 す る.そ る 内 容 を M の 出 力(計
して,そ
算 結 果)と 考 え る.
の と きテ ー プ 上 に記 入 され て い
2.2 簡 単 な確 率 的Turing機 2.2.1
械
記 憶 容 量 1 ビ ッ ト の 確 率 的Turing機
上 で 説 明 したTMは,現
械
在 の状 態 と,そ の と きヘ ッ ドが 読 ん で い る記 号 が 指 定
さ れれ ば,次 に 遷 移 す べ き状 態 が 一 意 に決 ま る の で,正 確 には 決 定 性Turing機 械 と呼 ば れ る.こ の 決 定 性 の 部 分 を拡 張 して,TMの
現 在 の 状 態 とヘ ッ ドが 読 ん
で い る 記 号 が 指 定 さ れ た と き に,次 の 動 作 が 確 率 的 に 決 定 され るTMを る こ とが で き る.こ の よ うなTMを Machine,以
下PTMと
以 下 で は,話
略 す)と
確 率 的Turing機
定義す
械(ProbabilisticTuring
い う.
を簡 単 に す るた め に,テ ープ が 1マ ス だ け か ら な る記 憶容 量 1ビ ッ
ト(注 1)の非常 に単 純 なPTMを を1PTM(1
bit PTMの
考 え る(図2.4参 略)と
照).本 書 で は,こ の よ う なPTM
呼 ぶ こ と にす る.以 下 で考 え る1PTMに
おい
て は,1 マ ス しか な い テ ー プ の マ ス 目 に 0が 書 き込 まれ て い る状 態 を 「状 態 0」, マ ス 目 に 1が 書 き込 まれ て い る状 態 を 「状 態 1」 と呼 ぶ こ と にす る.し た が って, この1PTMが
「状 態 0」 の と きに は ヘ ッ ドは必 ず 記 号 0を読 ん で お り,「状 態 1」
の と きに は ヘ ッ ド は必 ず 記 号 1 を読 ん で い る こ とに な る.こ の よ う に1PTMの 動 作 は,図2.5の
よ うな 状 態 遷 移 図 で 表 す こ とが で きる.図2.5の
遷移 図で注意
す べ き こ とは,矢 線 に付 け られ て い る ラベ ル が,そ の 矢 線 に 対 応 す る状 態 遷 移 が 起 こ る確 率 に な っ て い る こ とで あ る. 図2.4の
よ う な 構 造 を 持 ち,図2.5の
と 呼 ぼ う.P
は 以 下 の よ う に 動 作 す る.ま
力 が テ ー プ 上 に 与 え ら れ る.も で,入
よ う に 遷 移 関 数 を 指 定 さ れ た1PTMを
ち ろ ん,P
ず,動
作 の 開 始 に 先 立 っ て, P に は 入
の テ ー プ に は マ ス 目 が 一 つ しか な い の
力 と い っ て も 0 ま た は 1 し か あ り得 な い.図2.4の
0 が 与 え ら れ て い る.し
た が っ て,図2.4で
態 0」 に セ ッ ト さ れ て い る.ヘ (図2.4の
は,起
場 合 に は,入
力 と して
動 前 の P の 有 限 制 御 部 は 「状
ッ ドは テ ープ の た だ 一 つ の マ ス 目 に書 か れ た 記 号
場 合 に は 0)を 読 ん で い る.こ
の と き,起
動後 の P の動作 は以下の よ
(注1)情報 量の単 位 を ビ ッ トとい う.1 ビ ッ トの情 報 は 2進数 の 1桁 で表 現 で き,二 つ の 選択 肢YesとNoの 区 別 を表 す.
P
図2.4記
憶 容 量 1 ビ ッ トの 確 率 的Turing機
図2.51PTMPの
械 P
状態 遷 移図
う に な る. 最 初,P
の 状 態 は 0 で あ る が,図2.5の
矢 線 は 2 本 あ り,そ
の ど ち ら に も 確 率1/2が
と い っ た 記 号 は 後 で 必 要 に な る が,い P が
状態 遷移 図で ノー ド 0か ら出ている ラ ベ ル 付 け さ れ て い る(図
ま は 無 視 し て い た だ き た い).こ
「状 態 0」 か ら 「状 態 0」 に 遷 移 す る 確 率 は1/2で
ら 「状 態 1」 に 遷 移 す る 確 率 も1/2で
あ り,か
あ る と い う こ と で あ る.し
中 の α,c の 意 味 は,
つ,「 状 態 0」 か た が っ て,P
を
「状 態 0」 か ら起 動 し た と き に,1 単 位 時 間 後 に P が 「状 態 0」 に な っ て い る 確 率 は1/2で
あ り,「状 態 1」 に な っ て い る 確 率 も や は り1/2で
(注1)PTMPは
,1 単 位 時 間 ご とに 1回の状 態 遷移 を行 うもの とす る.
あ る こ と に な る(注1).
2.2.2
状 態 ベ ク ト ル と遷 移 行 列
この よ うな状 態 遷 移 を行 列 とベ ク トル を用 い て 表す 方法 が あ る.ま ず , 上 で 述 べ た, P が 「状 態0 」 に な っ て い る 確 率 が1/2で
て い る確 率 もや は り1/2で を,以
あ り,か つ 「状 態 1」 に な っ
ある
下 の よ う な ベ ク ト ル で 表 現 す る こ と に し よ う.
こ の ベ ク トル の 第 1行 成 分 は,P 成 分 は,P
が 「状 態 0」 で あ る確 率 を 表 して お り,第 2行
が 「状 態 1」 で あ る確 率 を 表 して い る.こ の よ うなベ ク トル を P の状
態 ベ ク トル とい う.し た が って,「状 態 0」 は状 態 ベ ク トル
で 表 され る.と い うの は,「状 態 0」 とは,P
が 「状 態 0」 で あ る 確 率 が 1で あ り,
か つ,「状 態 1」 で あ る確 率 が 0で あ る状 態 に ほ か な ら ない か らで あ る.同 様 の 理 由 に よ り,「状 態 1」 は状 態 ベ ク トル
で 表 さ れ る.
この と き,図2.5に
行 列 A に お い て,第
示 され た状 態 遷 移 は次 の行 列 で 表 現 で きる.
1行 お よび 第 1列 が 「状 態 0」 に,第
「状 態 1」 に対 応 して い る.こ
2行 お よ び第 2列 が
の と き,行 列 A の 第 i行 第 j 列 成 分 は,
P が 「状 態j-1」 を 表 し て い る.す
な わ ち,以
か ら 「状 態i-1」
に遷 移 す る確 率
下 の よ う な 対 応 関 係 に な る.
A の 第 1行 第 1列 成 分:P
が 「状 態 0」 か ら 「状 態 0」 に遷 移 す る確 率
A の 第 1行 第 2列 成 分:P
が 「状 態 1」 か ら 「状 態 0」 に遷 移 す る確 率
A の 第 2行 第 1列 成 分:P
が 「状 態 0」 か ら 「状 態 1」 に遷 移 す る確 率
A の 第 2行 第 2列 成 分:P
が 「状 態 1」 か ら 「状 態 1」 に遷 移 す る確 率
例 え ば,行 列 A の 第 1行 第 2列 成 分 は1/3で か ら 「状 態 0」 に遷 移 す る確 率 で あ り,図2.5の
あ るが,こ
の 値 は P が 「状 態 1」
ノ ー ド 1か ら ノ ー ド 0 に 向 か う
矢 線 に ラベ ル付 け され た値 と一 致 してい る.こ の よ うな行 列 A を P の 状 態 遷 移 行 列 とい う.一 般 に,
を任 意 の状 態 ベ ク トル とす る と き,P
の 状 態 遷 移 は 以 下 の 式 で表 現 す る こ とが で
き る.
例 え ば,状
態 ベ ク ト ル υ0は 以 下 の よ う に 変 換 さ れ る.
す な わ ち,P
の最 初 の 状 態 が 「状 態 0」 だ っ た と き に は,そ の 状 態 を 表 現 す る ベ
ク トル υ0に 遷 移 行 列 A を左 か ら掛 け る こ とに よ り,P の 1単位 時 間 後 の 状 態 を 表 す ベ ク トルuが
得 られ る.
同 様 に して,P
を 「状 態 0」 か ら 2単 位 時 間 動 作 させ た と きの 状 態 は,以 下 の
計 算 に よ り得 られ る.
す な わ ち,1PTMPは,「
状 態 0」 か ら 動 作 を 開 始 す る と,2 単 位 時 間 後 に は ,「状
態 0」 で あ る 確 率 が5/12,「
2.2.3
状 態 1」 で あ る 確 率 が7/12に
な る.
状 態の重 ね合 わ せ
上 で 述 べ た よ う に,1PTMPは,「
状 態 0」 か ら動 作 を開 始 す る と,2 単 位 時 間
後 に は,「状 態 0」 で あ る確 率 が5/12,「 状 態 1」 で あ る確 率 が7/12と
なるわけだ
が,こ
箱 の 中に入
の こ との 意 味 を少 し考 え て み よ う.例 え ば,こ
の1PTM
Pを
れ て蓋 を して し まい,「状 態 0」 か ら 2単 位 時 間 だ け 動 作 させ る(こ の 間 ,箱 の 中 は 見 な い).そ
して,2 単 位 時 間 後 に蓋 を 開 け て ,箱 の 中 の P が ど の状 態 にあ る
か を 「観 測 」 す る こ と に し よ う. い う まで もな く,そ の よ うな 観 測 の 結 果 は,「状 態 0」 ま た は 「状 態 1」 に確 定 す る.な ぜ な ら,機 械 で あ る1PTM
Pが
あ る時 点 に お い て 取 り得 る状 態 は ,「状 態
0」 ま た は 「状 態 1」 の 2通 り しか あ り得 な い か らで あ る.そ れ で は ,上 の状 態 ベ ク トル w は い っ た い何 を表 現 して い るの だ ろ うか? 状 態 ベ ク トル w が 表 現 し て い る こ と を,確 率 の 立 場 か ら述 べ れ ば以 下 の よ うに な る. 「P を 「状 態 0」 か ら 2単 位 時 間箱 の 中 で動 作 させ,そ
の後 ,蓋 を 開
け て P の 状 態 を観 測 す る 」 とい う試 行 を12回 行 えば,そ の うちの 5 回 は 「状 態 0」 が 観 測 さ れ,残
りの 7回 は 「状 態 1」が 観 測 され る .
この よ うな解 釈 を,重 ね合 わせ 状 態 の 確 率 的 解 釈 とい う.
2.2.4
遷移行列が満 たすべ き条件
上 で 述 べ た よ うに,1PTM 定 す れ ば よい.と
Pを
一 つ 指 定 す る た め に は,遷 移行 列 A を一 つ指
こ ろで 遷 移 行 列 A と して は,ど の よ うな行 列 を指 定 して も構 わ
な い の で あ ろ うか? 答 え は 否 で あ る. 話 を簡 単 に す る ため に,上 の例 と同 じ記 憶 容 量 1ビ ッ トのPTMの て説 明 す る.こ の 場 合,1PTMの
場合 につい
状 態 遷 移 図 に対 応 す る遷 移 行 列 A は 2行 2列
に な る.そ
こ で,遷
と 置 こ う.ま
移行 列 A の一般形 を
ず,a,b,c,dは
確 率 を 表 し て い る か ら,
a〓0,b〓0,c〓0,d〓0
を満 た さ な け れ ば な らな い.次
に,図2.5か
(1)
らわ か る よ う に,「状 態 0」 に 対 応 す
る ノー ドか ら は 2本 の矢 線 が 出 て お り,そ れ ら には 確 率 a と cが ラベ ル付 け され て い る.「状 態 0」 か らは,「状 態 0」 また は 「状 態 1」 の ど ち らか に遷 移 しな け れ ば な ら ない か ら,こ れ ら 2通 りの 状 態 遷 移 が 起 こ り得 るす べ て の場 合 で あ る.し た が って,こ
の 二 つ の 状 態 遷 移 が 起 こ る確 率 を足 し合 わ せ る と,そ の 値 は 1に な ら
な け れ ば な ら な い.す な わ ち, a+c=1
が 成 り 立 た な け れ ば な ら な い.ま
た,同
(2) 様 の 理 由 に よ り,
b+d=1 も成 り立 た な け れ ば な らな い.以
(3)
上 の(1)∼(3)式
が,遷 移 行 列 A の 成 分 が 満
た さな け れ ば な ら ない 条 件 で あ る.逆 に,上 の(1)∼(3)式
を満 たすa,b,c,dを
勝 手 に 1組 選 ん で 遷 移 行 列 A を 指 定 す れ ば,必 ず そ れ に対 応 す る1PTMが
存在
す る.
2.2.5 PTMの
計算木 動 作 を 表 現 す る も う一 つ の 方 法 と して,計 算 木 を用 い る 方 法 を紹 介 し
よ う.例 と して,上 で 示 した1PTM
Pを
「状 態 0」 か ら起 動 して,2 単 位 時 間
動 作 させ た と きの 計 算 木 を 図2.6に 示 す.計 算 木 は 幾 つ か の ノー ド と,そ れ らの ノ ー ド を結 ぶ 辺 か らな る.図2.6に
お い て は,ノ
ー ドは 丸 印 で 表 され てお り,辺
は 丸 印 を 結 ぶ 線 分 で 表 さ れ て い る.図 の 名 前 で あ る.各
ノ ー ド は,そ
中 のn1,n2,…,n7は
れ が 「状 態 0」 に 対 応 す る ノ ー ド で あ る か ,「状 態
1」 に 対 応 す る ノ ー ド で あ る か に 従 っ て,そ て い る.二
つ の ノ ー ド を 結 ぶ 辺 に は,そ
付 け さ れ て い る.例
え ば,ノ
本 書 で は,計
ー ドn1とn2は
と も に 「状 態 0」 に 対 応 し て お り, Pが
「状 態 0」 か ら 「状 態 0」 に 遷 移
ラ ベ ル 付 け さ れ て い る. 算 木 を 図 示 した 場 合 に は,辺
か っ て い る も の と解 釈 す る.例 らn2に
れ ぞ れ 0 ま た は 1で ラ ベ ル 付 け され
の 辺 に対 応 す る状 態 遷 移 の 確 率 が ラベ ル
そ れ ら 二 つ の ノ ー ド を結 ぶ 辺 に は,1PTM す る 確 率1/2が
え ば,図2.6の
向 か っ て い る も の と 考 え る.二
は 上側 の ノー ドか ら下側 の ノー ドに向 ノ ー ドn1とn2を
ド の 子 と 呼 ぶ.例
で あ る.計 の,た
に,終
点 ノー ド を出 発 点 ノー
親 で あ り,n2はn1の
子 で あ る .計 算 木 に お
が 1本 も 入 っ て こ な い ノ ー ド を 根 と 呼 び ,辺
が 1本 も 出 て い か な い ノ ー
ド を 葉 と 呼 ぶ.例
え ば,n1はn2の
結 ぶ 辺 は , n1か
つ の ノー ドが 直 接 辺 で 結 ばれ て い る と き,
そ の 辺 の 出 発 点 ノ ー ド を 終 点 ノ ー ド の 親 と 呼 び,逆
い て,辺
計 算 木 内 の 各 ノー ド
え ば,図2.6の
計 算 木 に お い て は,n1が
算 木 内 の 各 ノ ー ド に は,根
え ば,図2.6の
葉
の よ う な辺 を つ なげ て得 られ る道 筋 を
計 算 木 の ノ ー ドn5の
た ど っ て 到 達 す る に は,n1→n2→n5と
場合
,根n1か
らn5に
辺 を
い うパ ス を必 ず 通 らな け れ ば な らな い .
根 か ら あ る ノ ー ド n に 到 達 す る 際 の,こ
図2.6
,n6,n7が
か らそ の ノ ー ド に辺 を た ど って 到達 す る ため
だ 1 通 り の 道 筋 が 必 ず 存 在 す る.こ
パ ス と い う.例
根, n4,n5
の よ う な パ ス の 中 に 含 ま れ る 辺 の 本 数 を,
1PTM Pの 計 算 木
ノ ー ド n の レ ベ ル と い う.例
え ば,ノ
根 か ら の 唯 一 の パ ス で あ り,こ
の パ ス の 中 に は 2本 の 辺 が 含 ま れ て い る の で,n5
の レ ベ ル は 2 で あ る.図2.6の
計 算 木 の 場 合 に は,レ
ル 1の ノ ー ド はn2,n3,レ
ー ドn5の
場 合 に は, n1→n2→n5が
ベ ル 0の ノ ー ド はn1,レ
ベ ル 2 の ノ ー ド はn4,n5,n6,n7で
P を 「状 態 0」 か ら 起 動 し て 箱 の 中 で 動 作 さ せ,2 の 状 態 を 観 測 す る 問 題 を,計 算 木 で は,一
表 し,一
ら に,上
あ る.
単位時間後 に箱 を開けてそ
算 木 の 視 点 か ら も う 一 度 考 え て み よ う.図2.6の
番 上 の ノ ー ドn1が
し て い る.さ
ベ
起 動 前 の P の 状 態(こ
か ら 2段 目 の ノ ー ドn2,n3は
番 下 の ノ ー ドn4,n5,n6,n7は
計
の 場 合 は 「状 態 0」)を 表
1単 位 時 間 後 の P の 状 態 を
2 単 位 時 間 後 の P の 状 態 を 表 し て い る.
こ こ で,2 単 位 時 間 後 に箱 を 開け て観 測 した と きに P が 「状 態 0」 で あ る確 率 を,計 算 木 を用 い て 求 め て み よ う.ま ず,図2.6の
計 算 木 を見 る と,2 単 位 時 間 後
に P が 「状 態 0」 に な るの は,P
到 達 す る場 合 と,ノ ー ドn6に
が ノー ドn4に
到 達 す る場 合 の 2通 りが あ る こ とが わ か る.P
が ノー ドn4に
到 達 す る の は, P
の 状 態 遷 移 が, 「状 態 0」(ノ ー ドn1)→ と 進 ん だ 場 合 で あ る.こ 移 し 」 か つ,そ
「状 態 0」(ノ ー ドn2)→
の よ う な状 態 遷 移 が 起 こ る の は,P
れ に 引 き続 い て 「n2か
か らn2に
遷 移 す る 」 確 率 は,図2.6か
か らn4に
遷 移 す る 」 確 率 も1/2で
す る 確 率 は,こ
「状 態 0」(ノ ー ドn4)
らn4に
が 「n1か
遷
遷 移 し た 」 と き に 限 る. P が 「n1
ら も わ か る よ う に1/2で あ る.し
らn2に
た が っ て, P がn1か
あ り, P が らn4に
「n2 到達
れ ら 二 つ の 確 率 の 積 に な る の で,
と な る.
同 様 に して,P
がn1
る 」 確 率1/2と,「n3か
か らn6に らn6に
到 達 す る 確 率 は, P が 「n1か 遷 移 す る 」 確 率1/3の
らn3に
積 に な る の で,
遷移す
と な る.し
た が って,2 単 位 時 間 後 に箱 を開 け て観 測 した と き に P が 「状 態 0」
で あ る確 率 は,P
が 「n1か らn4に
到 達 す る 」事 象 と 「n1か らn6に
到 達 す る」
事 象 の確 率 の 和 に な るの で,
と 求 ま る.こ
の 値 は,2.2.2節
で 示 し た(*)式
の 状 態 ベ ク ト ル w の 第 1行 成 分 の
値 と 一 致 し て い る.
計算木 が満 たすべ き条件
2.2.6 図2.6よ
うな木 を書 け ば,な
ん で もPTMに
答 え は 否 で あ る.計 算 木 がPTMの
対 す る 計 算 木 に な る の だ ろ うか?
状 態遷 移 を表 現 す る た め に は,以 下 の 三 つ の
条 件 を満 た さな け れ ば な らな い. 1.
計 算 木 内 の 同 じラベ ル を持 つ ノー ド に お い て は,辺 の 枝 分 か れ の 仕 方 が 同 一 で な け れ ば な らな い .
2.
計 算 木 内 の親 か ら子へ の 遷 移 は,PTMの
対 応 す る状 態 遷 移 と して実 現 可 能
で な け れ ば な らな い. 3.
計 算 木 の 各 レベ ル に お い て,そ の レベ ル に現 れ るす べ て の ノ ー ドの発 生確 率 の 合 計 は,常
ま ず,条
に 1で な け れ ば な ら な い.
件 1 に つ い て 説 明 す る.図2.6に
ち ら も ラ ベ ル が 0 で あ る が,こ
お い て,例
か れ の 状 況 は 完 全 に 一 致 して い な け れ ば な ら な い.実 ら は,「状 態 0」 の 子(n2)へ
の 確 率1/2の
1/2の
様 に,n2か
遷 移 が 起 こ り得 る.同
の 遷 移 と,「状 態 1」 の 子(n5)へ ドn1とn2に
つ い て は,条
ドn1とn2を
際,図2.6に
遷 移 が 起 こ り 得 る.よ
件 1が 満 た さ れ て い る.図2.6に
上 の 条 件 2 も満 た し て い る.例 結 ぶ 辺 が あ る が,1PTM
お い てn1か
ら も,「状 態 0」 の 子(n4)へ
の 確 率1/2の
Pに
ど
お け る子 へ の 枝 分
遷 移 と,「状 態 1」 の 子(n3)へ
適 用 さ れ ね ば な ら な い ノ ー ド が な い の で,図2.6は ま た,図2.6は
え ば ノ ー ドn1とn2は
の よ う な 場 合 に は,n1とn2に
は,ほ
の確 率 の 確 率1/2 っ て,ノ
ー
か に 条 件 1が
条 件 1 を 満 た し て い る. え ば,図2.6の
計 算 木 に は ノー
お い て は 「状 態 0」 か ら 「状 態 1」
へ の 遷 移 が 確 か に可 能 で あ る.実 際,P
に お い て は,「状 態 0」 と 「状 態 1」 の 間
の す べ て の 状 態 遷 移 が 可 能 だ か ら,条 件 2は当 然 満 た され て お り,こ の 例 か らは 条件 2の 本 質 が わ か りに くい.条 件 2が 本 質 的 に意 味 を持 っ て くる の は,後 で 述 べ る 一 般 のPTMや 最 後 に,条
量 子Turing機
件 3 に つ い て 見 て お こ う.図2.6の
ノ ー ド はn2,n3,レ
な っ て い る.ま
計 算 木 の 場 合 に は,レ
ベ ル 2 の ノ ー ド はn4∼n7で
て 考 え る と,n2とn3の
発 生 確 率 は と も に1/2で
た,レ
1/4,1/4,1/6,1/3で
あ る .ま あ り,そ
ベ ル 2 に つ い て は,n4,n5,n6,n7の あ り,こ
る こ と が わ か る.し 図2.6の
械の場合で ある.
ず,レ
ベ ル 1に つ い
れ らの 和 は確 か に 1に 発 生 確 率 は そ れ ぞ れ,
れ ら す べ て の 和 を 求 め る と,確
た が っ て,図2.6の
ベ ル 1の
か に 1に な っ て い
計 算 木 は 条 件 3 も満 た し て い る .以
計 算 木 は 上 の 三 つ の 条 件 を す べ て 満 た し て お り,計
上 で,
算 木 と して 適 格 で あ
る こ と が 確 認 で き た.
2.3 2.3.1
機械
記 憶 容 量 1 ビ ッ ト の 量 子Turing機
本 節 で は,量 す)の
機械
簡 単 な 量 子Turing機
子Turing機
械(Quantum
Turing Machine,以
直 観 的 イ メ ー ジ を持 っ て い た だ くた め に,最
同 様,記
憶 領 域(メ
以 下1QTMと 前 節 の1PTMと
モ リ)を
略 す)の
も 簡 単 なQTMと
1 ビ ッ ト しか 持 た な い 量 子Turing機
例 を 示 す.そ
の1QTMの
ま っ た く同 じで あ る.し
か し,後
下QTMと
略
し て,前 械(1bit
節 と
QTM,
構 造 は 図2 .7の と お り で あ り, で わ か る こ と だ が,そ
の 機 能や
物 理 的 実 現 方 法 は ま っ た く異 な っ て い る.
1QTMに
お い て は,テ ー プ の 一 つ の マ ス 目 は, 0が 書 き込 ま れ て い る状 態(前
節 の 「状 態0」)と,1
が 書 き込 まれ て い る状 態(前 節 の 「状 態 1」)の 任 意 の 重 ね
合 わ せ を保持 す る こ とが で き る.し た が って,1QTMの
ヘ ッ ドは,こ の よ うな状
態 の 重 ね 合 わ せ を読 み書 きす る こ とが で きる と仮 定 され て い る.こ の よ うな 「状 態 0」 と 「状 態 1」 の任 意 の 重 ね 合 わ せ を保 持 で き る ビ ッ トを キ ュ ー ビ ッ ト(qubit
,
quantum
bitの
2.3.2
1QTMの
1QTMの
略)と
呼 ぶ.
計 算木
動 作 を,計 算 木 を用 い て 説 明 し よ う.図2.7の
2.8の よ うな計 算 木 に よ って動 作 を指 定 され た1QTMを 算 木 つ い て い え ば,1PTMと1QTMの 「1QTMの
よ うな構 造 を持 ち,図 Q と呼 ぶ こ と にす る.計
違 い は,以 下 の た だ 1点 の み で あ る.
場 合 に は,計 算 木 の枝 の ラベ ル と して(0 以 上 の 実 数 ば か
りで な く),任 意 の 複 素 数 が 使 用 で き る.」 た だ し,1QTMの
計 算 木 の解 釈 は,前 節 で 述 べ た1PTMの
異 な って い る.す な わ ち,前 節 の1PTMに 「実 際 に動 作 して い る1PTMは,根
計 算 木 の 場 合 とは
対 す る計 算 木 の 場 合 に は, か ら葉 に至 る可 能 な 4通 りの計 算
パ ス の うち の た だ 一 つ を実 行 して い る 」 と解 釈 し た.し
か し,図2.8の
よ う な1QTMに
「実 際 に動 作 して い る1QTMは,根
対 す る 計 算 木 の 場 合 に は,
か ら葉 に至 る 可 能 な 4通 りの計
算 パ ス の す べ て を(一 つ のハ ー ド ウ ェ ア 上 で)同 時 に実 行 して い る 」 と解 釈 す る. も う少 し詳 し く説 明 す る.ま ず,動 作 の 開 始 に先 立 っ て,Q 上 に 与 え られ る.も ち ろ ん,Q
図2.7
には入力が テープ
の テ ー プ には マ ス 目が 一 つ しか な い の で,入 力 と
記 憶 容 量 1 ビ ッ トの 量 子Turing機
械 Q
(a) 図2.8
1QTM
Qの
(b)
計 算 木. (a) 「状態 0」か ら起 動 した場 合, (b) 「 状 態 1」か ら起動 した場合.
い っ て も 0 ま た は 1 し か あ り得 な い.図2.7の れ て い る.ま
た 図2.7で
て い る と 考 え る.ヘ
は,起
場 合 に は ,入
動 前 の Q の 有 限 制 御 部 は 「状 態 0」 に セ ッ ト さ れ
ッ ド は テ ー プ の た だ 一 つ の マ ス 目 に 書 か れ た 記 号(図2.7の
場 合 に は 0)を 読 ん で い る.1QTMQも,1 う も の と す る.こ
1QTMQを
力 と して 0が 与 え ら
の と き,起
単 位 時 間 ご と に 1 回 の 状 態 遷 移 を行
動 後 の Q の 動 作 は 以 下 の よ う に な る.
「状 態 0」 か ら起 動 して,2 単 位 時 間動 作 させ た と きの 計 算 木 を図
2.8(a)に,「 状 態 1」か ら起動 して,2 単 位 時 間動 作 させ た と きの計 算 木 を図2.8(b) に そ れ ぞ れ示 して あ る.計 算 木 の 表 記 法 は 図2.6の 場 合 とほ ぼ 同 様 で あ るが,た だ 1点 異 な って い る の は,図2.8で
は辺 の ラベ ル と して負 の 実 数 が 現 れ て い る こ
とで あ る(注1).負 の 数 が 現 れ て い る こ とか ら も わ か る よ うに,辺 れ た こ れ らの 数 は確 率 で は な い.1QTMの は,対 応 す る1QTMの
に ラベ ル付 け さ
場 合 に は,各 辺 に ラベ ル付 け され た数
状 態 遷 移 の振 幅 と呼 ば れ る.振 幅 を 2乗 した値 が対 応 す
る状 態 遷 移 の 確 率 と な る. 例 え ば,図2.8(b)の
計 算 木 の ノ ー ドn2とn5を
ル 付 け され て い る が,こ (注 1)
の 値 がn2か
上で も述 べ た よ う に,1QTMに きる.し か し図2.8の
らn5へ
結 ぶ 辺 に は,-1/√2が
ラベ
の 状 態 遷 移 の 振 幅 で あ り,こ の 状
対 す る計 算 木 の辺 の ラ ベル と して は,任 意 の複 素 数 を 一般 に は使 用 で
例 で は,辺 の ラベ ル と して 正 と負 の実 数の み が用 い られ て い る.
態 遷 移 が 起 こ る確 率 は,
と な る.
Q を 「状 態 1」 か ら起 動 して 箱 の 中 で動 作 させ,2 単 位 時 間 後 に箱 を 開 け て そ の 状 態 を観 測 す る こ とを考 え てみ よ う.図2.8(b)の ドn1が
起 動 前 の Q の 状 態(こ
は な い.)を 表 して い る.さ
計 算 木 で は,レ ベ ル 0の ノ ー
の 場 合 は 「状 態 1」.こ れ は重 ね 合 わせ の 状 態 で
らに,レ ベ ル 1の ノ ー ドn2とn3に
対 応 す る状 態 の
重 ね合 わ せ が 1単 位 時 間後 の Q の 状 態 を 表 し,レ ベ ル 2の ノー ドn4∼n7に
対
応 す る すべ ての 状 態 の 重 ね合 わせ が 2単 位 時 間後 の Q の 状 態 を 表 し てい る. こ こ で,2 単 位 時 間 後 に箱 を開 け て観 測 した と き に Q が 「状 態 1」 で あ る確 率 を求 め て み よ う.ま ず,図2.8の にな る の は,Q
が ノー ドn5に
重 りが あ る こ とが わ か る.Q 「状 態 1」 (ノ ー ドn1)→ と 進 ん だ 場 合 で あ る.こ 遷 移 し 」 か つ,そ 「n1か
らn2に
り,Q
が
Q がn1か
計 算 木 を見 る と,2 単位 時 間 後 に Q が 「状 態 1」 到 達 す る場 合 と,ノ ー ドn7に が ノー ドn5に 「状 態
到 達 す るの は, Q の 状 態 遷 移 が,
0」(ノ ー ドn2)→
らn5に
遷 移 す る 」 事 象 の 振 幅 は,図2.8か
「n2か らn5に
らn5に
「状 態 1」(ノ ー ドn5)
の よ う な 状 態 遷 移 が 起 こ る の は,Q
れ に 引 き 続 い て 「n2か
が 「n1か
らn2に
遷 移 し た 」 と き に 限 る. Q が ら も わ か る よ う に1/√2で
遷 移 す る 」 事 象 の 振 幅 は-1/√2で
遷 移 す る 事 象 の 振 幅 は,こ
到 達 す る場 合 の 2
あ る.し
あ
た が っ て,
れ ら 二 つ の 振 幅 の 積 に な る の で,
と な る. 同 様 に し て,Q
がn1か
遷 移 す る 」 振 幅1/√2と,「n3か
らn7に
遷 移 す る 事 象 の 振 幅 は, Q2が らn7に
遷 移 す る 」 振 幅1/√2の
「n1か
らn3に
積 に な る の で,
と な る.し た が っ て,2 単 位 時 間 後 に 箱 を 開 け て 観 測 した と き に Q が 「状 態 1」 で あ る事 象 の振 幅 は,P
が 「n1か らn5に
到 達 す る」 事 象 と 「n1か らn7に
到
達 す る」 事 象 の 振 幅 の 和 に な る の で,
と 求 ま る.ゆ し た が っ て,2
え に,2 単 位 時 間 後 に Q が 単 位 時 間後 に Q が
「状 態 1」 で あ る 確 率 は02=0と
「状 態 0」 で あ る 確 率 は1-0=1で
なる. あ る.
こ こ で注 意 す べ き こ と は,も ち ろ ん,2 単 位 時 間 後 に Q が 「状 態 1」 で あ る確 率 が,0 に な っ て し まっ た こ とで あ る.こ れ は 次 の 理 由 に よる.1QTMの
状 態遷
移 の確 率 を 求 め る には,ま ず そ の 遷 移 の 振 幅 を求 め て か ら,そ の値 を 2乗 しな け れ ば な ら な いが,振
幅 を求 め る 際 には,正
の 数 ば か りで な く負 の数 も足 し合 わ せ
る こ とが あ る の で,振 幅 が 0 に な る可 能 性 が あ る .こ の よ うな こ とは,図2.6の よ うな1PTMに
お け る 状 態 遷 移 確 率 の 計 算 に お い て は 絶 対 に起 こ らな い こ と
に 注 意 され た い. 上 で 述 べ た こ とか ら,Q
を 「状 態 1」 か ら起 動 して 箱 の 中 で動 作 させ,2 単 位
時 間 後 に箱 を 開 け て そ の 状 態 を観 測 す る と,必 ず 「状 態 0」 とな る こ と が わ か っ た.逆
に,Q
を 「状 態 0」 か ら起 動 して箱 の 中で 動 作 させ ,2 単 位 時 間 後 に 箱 を
開 け て その 状 態 を観 測 す る と,必 ず 「状 態 1」 と な る こ とが 同様 の議 論 に よ りわ か る.以 上 の こ とか ら,1QTM
Qは
2ス テ ップ か け て ,入 力 値 の 否 定(注1)を計
算 す る こ とが わ か る.し た が って Q は,1 ス テ ップ で は 否 定 の 平 方 根 を計 算 して い る よ うに 見 え るの で,Square
Root of NOTと
呼 ば れ て い る.
状態の干渉
2.3.3
上 の 計 算 に お い て注 意 す べ きこ とは,2 単 位 時 間後 に Q が 「状 態 1」 で あ る確 率 を,Q
が 「n1か らn5に
到 達 す る 」振 幅 と 「n1か らn7に
の 2乗 と して求 め て い る こ とで あ る.見 方 を変 えれ ば,n5に で 現 れ る 「状 態 1」 と,n7に (注1)
0の 否 定 は1,1の
お い て 振 幅1/√2で
否 定 は 0で あ る.
到 達 す る」振 幅 の 和 お い て振 幅-1/√2
現 れ る 「状 態 1」 が 互 い に打 ち
消 し合 っ て,全 体 と して確 率 0で 現 れ る 「状 態 1」 を 形 成 して い る と も考 え られ る.こ の よ う な状 態 の相 互 作 用 を状 態 の 干 渉 と呼 ぶ.こ の例 の場 合 に は,「状 態 1」 が 現 れ る確 率 が 弱 め られ て い る の で,こ の よ うな 形 の 干 渉 を負 の 干 渉 とい う. 2単位 時 間 後 に Q が 「状 態 0」 で あ る こ とが 観 測 され る確 率 も,同 様 に して, Q が 「n1か らn4に
到 達 す る」 事 象 の振 幅 と 「n1か らn6に
到 達 す る 」事 象 の
振 幅 の和 の 2乗 と して以 下 の よ うに求 め られ る.
こ こ で は 上 と は逆 に,あ る状 態 が 現 れ る確 率 が 強 め られ る 形 の,状 態 の正 の 干 渉 が 見 られ る.
計算木 が満 たすべき条件
2.3.4 1PTMの
場 合 と同様 に,図2.8の
よ う な計 算 木 が1QTMの
状 態 遷 移 を表 現 す
る た め に は,以 下 の 三 つ の 条 件 を満 た さな け れ ば な ら ない. 1.
計 算 木 内 の 同 じラ ベ ル を持 つ ノ ー ドに お い て は,辺
の枝 分 か れ の 仕 方 が 同
一 で なけ れ ば な ら な い . 2.
計 算 木 内 の 親 か ら子 へ の遷 移 は,1QTMの
対 応 す る状 態 遷 移 と して 実現 可
能 で な け れ ば な らな い. 3.
計 算 木 の 各 レベ ル にお い て,そ の レベ ル に現 れ るす べ て の ノー ド の発 生確 率 の 合 計 は,常
に 1で なけ れ ば な ら ない.
こ れ ら の 条 件 は,1PTMの
場 合 と ま っ た く同 じ で あ る.例
計 算 木 は 上 の 3 条 件 を す べ て 満 た し て い る.条 し て 確 認 で き る の で,こ 木 の 場 合 に は,レ る.ま
ず,レ
な の で,Q
件 1と 2 につ い て は前 節 と同 様 に
こ で は 条 件 3 に つ い て だ け 見 て お こ う.図2.8(b)の
ベ ル 1 の ノ ー ド はn2,n3,レ
ベ ル 1 に つ い て 考 え る と,n2とn3に がn2ま
え ば,図2.8(b)の
た はn3に
到 達 す る 確 率 は,
計算
ベ ル 2 の ノ ー ド はn4∼n7で 対 応 す る 振 幅 は と も に1/√2
あ
と な る.ま
た,レ
ベ ル 2 に つ い て は,n4,n5,n6,n7に
1/2,-1/2,1/2,1/2な
と な る.し
1PTMの
がn4か
た が っ て,図2.8(b)の
1QTMの
2.3.5
の で,Q
らn7の
対 応 す る 振 幅 は そ れ ぞ れ, い ず れ か に 到 達 す る 確 率 は,
計 算 木 は 条 件 3 を 満 た し て い る,
遷移 行列
場 合 と同様 に,1QTMの
状 態 遷 移 も遷 移 行 列 を用 い て表 す こ とが で
き る.前 節 と 同様 に,「状 態 0」 は状 態 ベ ク トル
で,「 状 態 1」 は 状 態 ベ ク ト ル
で 表 す こ とに す る. こ の と き,図2.8の
計 算 木 で 示 さ れ た状 態 遷 移 は次 の 状 態 遷 移 行 列 で 表 現 で
き る.
以 前 と ま っ た く同様 に,行 列AQに に,第
お い て は,第
1行 お よ び 第 1列 が 「状 態 0」
2行 お よ び第 2列 が 「状 態 1」 に対 応 して い る.こ
の と き,行 列AQの
i行 第 j列 成 分 は, Q が 「状 態j-1」 を 表 し て い る.
か ら 「状 態i-1」
に遷 移 す る事 象 の 振 幅
第
例 え ば,状
態 ベ ク ト ル υ1は
同様 に して,Q
A に よ っ て 以 下 の よ う に 変 換 さ れ る.
を 「状 態 1」 か ら 2単 位 時 間動 作 させ た と きの 状 態 は,以 下 の 計
算 に よ り得 られ る.
す な わ ち,1QTM
Qは,「
状 態 1」 か ら 動 作 を 開 始 す る と,2 単 位 時 間 後 に は,確
率 1で 「状 態 0」 に 遷 移 す る.こ
次 に,1QTMの
の こ と は,上
で 述 べ た こ と と 一 致 して い る.
状 態 遷 移 行 列 が満 たす べ き条 件 に つ い て 考 えて み よ う.1QTM
の 状 態 遷 移行 列 A は 2行 2列 に な る.そ こで,遷 移 行 列 A の 一 般 形 を
と置 こ う.す
る と 一 般 に,
を任 意 の 状 態 ベ ク トル とす る と き,Q の 状 態 遷 移 は 以 下 の 式 で 表現 す る こ とがで きる.
(**) 今 度 の 場 合 に は,a,b,c,dは
確 率 で は な く振 幅 を表 して い るの で,任 意 の複 素
数 を値 と して取 れ る.し た が っ て,1PTMの
と きの よ う に簡 単 に結 論 は導 け な い.
実 は,上 の よ うな状 態 遷 移行 列 が,計 算 木 に 対 す る三 つ の 条 件 を満 た す よ うな変 換 を 定義 す る た め に は,以 下 の 条 件 を満 足 す れ ば よ い こ とが 知 られ て い る. QTMの
状 態 遷 移 行 列 は,ユ
ニ タ リ行 列 で な け れ ば な らな い.
行 列 A が ユ ニ タ リ で あ る と は, AA+=A+A=I が 成 り 立 つ と き を い う.こ
こ で,A+は
行 列 A の 転 置 共 役 行 列 を 表 す.つ
行 列 A の i行 j 列 成 分 の 共 役 複 素 数(注1)が,行
列A+の
j 行i列
ま り,
成 分 と な る.
例 え ば,
な ら ば,
とな る.こ 実 際,上
こで,a
は複 素 数 a の 共 役複 素 数 を表 して い る.
の行 列AQの
転 置 共 役 行 列 は以 下 の よ う に求 まる.
こ の と き,
と な り,同 様 に してA+QAQ=Iも
示 す こ とが で き る の で, AQは
リ行 列 で あ る.し た が って,AQは1QTMの
確 かにユニ タ
状 態 遷 移 行 列 と して適 格 で あ る こ と
が わ か る. 量 子 力 学 を ご存 じの 方 に は,前 ペ ー ジの(**)式 の 発 展 過 程 の時 間 推 移 行 列(ユ
ニ タ リ行 列)に
が,物 理 系(こ の 場 合 は1QTM) よ る表 現 に な っ てい る こ とが お わ
か りい た だ け る こ と と思 う. (注 1)
複 素数x+iyとx-iy(x,yは て,実 数xの 共 役 複 素数 はx自
実 数, iは 虚 数単位)は, 互いに他 の共 役 複 素 数で あ る.し たが っ 身 で あ るこ とに注 意 す る.
の因数 分 解 ア ル ゴ リズ ムの動 作 原理
Shor
2.4
本 節 で は,AT&T,
Bell研 究 所 のShorに
よ っ て 考案 され た,量 子Turing機
械 上 の 効 率 的 な 因数 分 解 ア ル ゴ リズ ムの 概 略 を直 観 的 に説 明す る.本 節 の詳 細 は, 第 6章 に記 述 す る.
因数 分解 の難 しさ
2.4.1
コ ン ピ ュ ー タ の 内 部 で は,整
数 を 2進 数 で 表 現 し て い る.し
を コ ン ピ ュ ー タの メモ リ 内 に 貯 え る に は,log Nビ
た が っ て,整
ッ ト を 必 要 と す る(対
数 N 数 の底
は 2 と す る).
ア ル ゴ リズ ム は,そ の実 行 ス テ ップ 数 が 入 力 長(ビ
ッ ト数)の 多 項 式 で押 さ え
られ る と きに,多 項 式 時 間 で 動 作 す る とい う. 因 数 分 解 問 題 の 場 合,入 与 え られ る 整 数Nはlog
Nビ
ッ トで 表 現 され るか ら,因 数 分 解 の ア ル ゴ リズ ム
A が 多 項 式 時 間 で動 作 す る と した ら,あ る 多項 式 P に対 し,A 数 が P(log N)以
力 と して
の 実 行 ス テ ップ
下 と な ら な け れ ば な らな い.理 論 上 は,多 項 式 時 間 で 動 作 す る
ア ル ゴ リズ ム が,効 率 の よ い ア ル ゴ リ ズ ム で あ る と考 え られ て い る. 例 え ば,1 以 上 √N以 分 解 法(エ
下 の 各整 数 で N を割 って み る とい う,最 も素 朴 な 因 数
ラ トス テ ネ ス の ふ る い)を 考 え て み よ う.こ の 方法 は 少 な く と も √N
ス テ ップ を必 要 とす る.し か し,√N=21/2logNはlogNに
関 す る指 数 関 数 で
あ り,し たが っ て,こ の ア ル ゴ リズ ム は多 項 式 時 間 で は動 作 しな い.実 際,因 分 解 に対 す る効 率 的 な(通 常 の)ア
数
ル ゴ リズ ムは 知 られ て い な い.現 在 知 られ て
い る最 良の ア ル ゴ リズ ム は,
2(log N)1/3(loglog
N)2/3
の オ ー ダ の ス テ ップ 数 で 動 作 す る.し か し,逆 に因 数 分解 に対 す る効 率 的 な(通 常 の)ア
ル ゴ リズ ム が 存 在 しな い とい う証 明 が な され た わ け で もな い.
現 在,200桁
の 整 数 を 因 数 分 解 し よ う と す る と,ス
い た と し て も,答
ー パ ー ・コ ン ピ ュ ー タ を 用
が 出 る ま で に は 数 十 億 年 も か か る と い わ れ て い る.こ
の ような
因数 分 解 の 難 し さ を よ りど こ ろ と して,RSAな れ,イ
2.4.2
ン ター ネ ッ ト上 な どで広 く利 用 され て い る.
量 子Turing機
械 とは
本 節 で は,量 子Turing機 1QTMの のQTMで
違 い は,1QTMで
械(QTM)の
直 観 的 説 明 を行 う.一 般 のQTMと
は 記 憶 容 量 が 1ビ ッ トに制 限 され る の に 対 し,一 般
は,そ の よ うな制 限 が な い とい う点 の み で あ る.同 様 の 関 係 が,一 般
の 確 率 的Turing機 ずPTMに
どの 公 開 鍵 暗 号 シ ス テ ム が 実 現 さ
械(PTM)と1PTMの
間 に も成 り立 つ の で,以 下 で は,ま
つ い て 説 明 し,そ の 後 にPTMと
まず,通 常 の 決 定 性Turing機 式 的 に は,図2.9の 定 性Turing機
の対 比 でQTMを
導 入 す る.
械 に よ る計 算 の様 子 を考 え て み よ う.そ れ は,図
よ うに 直 線 的 に 表 現 す る こ とが で きる.す
な わ ち,通 常 の 決
械 に よ る計 算 に お い て は,計 算 の 各 ス テ ップ に お い て,次
に 実行
可 能 な ステ ップ は,(存 在 す る な らば)一 意 的 に定 ま る. これ に対 し,通 常 のPTMに
よ る計 算 の 様 子 は,図2.10の
よ うな木 の形 で 表 現
さ れ る.す な わ ち,こ の 場 合 に は,計 算 の 各 ステ ップ に お い て,次 に 実 行 可 能 な ス テ ップ は,一 般 に一 意 的 に は 定 ま らず,高
図2.9
々2つ の 可 能 な もの の 中 か ら,あ る
通常の決定性計算
図2.10
通常の確率的計算
確 率 に従 っ て 選 ば れ る. 例 え ば,計
算 の あ る ス テ ップ に到 達 した と き に,次
種 類 存 在 した 場 合,PTMは テ ップ を,さ
に実 行 可 能 なス テ ップ が 2
内 部 的 に コ イ ン投 げ を行 っ て,表 が 出 た ら第 1の ス
もな け れ ば 第 2の ス テ ップ を実 行 す る .
逆 に,図2.10の
よ うな木 は,あ るPTMの
よ うな木 を描 い て も,そ れ が常 にPTMの 2.10の よ うな 木 がPTMの
計 算 過 程 を表 現 す る わ け だ が,ど の 計 算 過 程 を 表 現 す る とは 限 ら ない.図
計 算 過 程 を表 現 す る には,以
下の 三 つ の 条 件 を満 た さ
なけ れ ば な らな い. 1.
同 じ 計 算 ス テ ッ プ か ら は,同 な い.例
え ば,図2.10の
で あ っ た と し よ う.こ
じ確 率 に 従 う状 態 遷 移 が 起 こ ら な け れ ば な ら
様 相(注1)Aと B に お い て,と の と き,も
も に機 械 の 状 態 が q
し様 相 A か ら の 遷 移 が,
「状 態 を γ に変 え,ヘ ッ ドの あ るマ ス 目に 記 号 bを書 き込 み,そ の 後 ヘ ッ ド を右 に 1マ ス動 か す 」 とい う遷 移 が 確 率1/2で
起こ
り, (注 1)あ
る時 刻 t にお け る,Turing機
械 M の 有 限制 御 部の 状態,テ
む対 を,時 刻 t にお け る M の様 相 とい う.
ー プ の内容,ヘ
ッドの 位 置 をす べ て 含
「状態 を s に 変 え,ヘ
ッ ドの あ るマ ス 目 に記 号 c を書 き込 み,そ
の 後 ヘ ッド を左 に 1マ ス動 か す 」 とい う遷 移 が確 率1/2で
起 こる
の で あ れ ば,こ れ と ま っ た く同様 の 遷 移 が様 相 B に お い て も起 こ ら なけ れ ば な らな い. 2.
木の 中 の あ る 親 に付 随 した 様 相 か ら,そ の 子 に 付 随 した 様 相 へ は,決 定 性 Turing機
3.
械 の 1ス テ ップ の動 作 で 遷 移 で きな け れ ば な らな い.
木 の レベ ル ご と に,そ の レベ ル の 頂 点 に 付 随 した様 相 の 発 生 確 率 を合 計 す る と,そ の和 は 1にな ら なけ れ ば な らな い.例
え ば,図2.10の
場 合,レ ベ
ル 0に あ る 頂 点 は木 の根 A だ け で あ り,そ の 発 生 確 率 は 1だ か ら,明 らか に この 条 件 は 満 た され る.レ ベ ル 1に は 頂 点 B と C が 存 在 す る.B
に対
応 す る様 相 の 発 生 確 率 は1/2,C
ある
に 対 応 す る様 相 の 発 生 確 率 は1/2で
か ら,そ の 合 計 は確 か に 1に な って い る.レ ベ ル 2 には 頂 点D,E, 在 す る.例
え ば,頂 点 D に対 応 す る様 相 の 発 生 確 率 は
で あ る.同
様 に し て,頂
1/4,1/2で
点E,Fに
あ る か ら,そ
対 応 す る 様 相 の 発 生 確 率 は,そ
Fが
存
れ ぞ れ,
れ ら の 合 計 は や は り 1 に な る.
このPTMの
場 合 の よ うに, QTMに
よ る計 算 の 様 子 も,図2.11の
表 現 さ れ る.す
な わ ち,こ の 場 合 に も,計 算 の 各 ステ ップ にお い て,次
能 な ス テ ップ は,一 般 に 一 意 的 には 定 ま らず,幾
よ う な木 で に実 行 可
つ か の 可 能 な もの の 中 か ら,あ
る確 率 に従 っ て選 ば れ る.た だ し,今 度 の 場 合 は,そ
の確 率 が 通常 の確 率 で は な
く,い わ ゆ る量 子 確 率 に な っ て い る. 例 え ば,計 算 の あ る ス テ ップ に到 達 した と き に,次 に 実 行 可 能 な ス テ ップ が 2 種 類 存 在 した 場 合,QTMも テ ップ を,さ
内 部 的 に コ イ ン投 げ を行 って,表
が 出 た ら第 1の ス
も な け れ ば 第 2の ス テ ップ を実 行 す る.た だ し,こ の 場 合 の コ イ ン
は一 般 に通 常 の コ イ ンで は な く,量 子 コ イ ン とで も呼 べ る もの で あ る. 図2.11の
木 が,PTMに
ら れ た 値 が,対
対 す る 図2.10の
木 と唯 一 異 な る点 は,木 の 辺 に付 け
応 す る状 態 遷 移 の 確 率 で は な く,そ の 振 幅 で あ る とい うこ とで あ
図2.11
る.そ れ以 外 は,確 率 的Turing機
量子確率的計算 械 に 対 す る計 算 木 と量 子Turing機
計 算 木 は ま っ た く同 じで あ る.す な わ ち,図2.11の の計 算 過 程 を表 現 す る た め に は,以 1.
同 じ計 算 ス テ ップ か ら は,同 な い.例 え ば,図2.11の
械 に対す る
よ うな木 が 量 子Turing機
械
下 の 三 つ の 条 件 を満 た さ な け れ ば な ら ない. じ確 率 に 従 う状 態 遷 移 が 起 こ らな け れ ば な ら
様 相 A と B に お い て は,図2.10の
場 合 と同様,
まっ た く同 じ遷 移 が 起 こ っ て い なけ れ ば な ら ない. 2.
木 の 中 の あ る 親 に 付 随 した 様 相 か ら,そ の子 に付 随 した 様 相 へ は,決 Turing機
3.
定性
械 の 1ス テ ップ の動 作 で 遷 移 で き なけ れ ば な らな い.
木 の レベ ル ご と に,そ の レベ ル の 頂 点 に付 随 した 様 相 の 発 生 確 率 を 合 計 す る と,そ の 和 は 1 に な らな け れ ば な らな い.例 え ば,図2.11の
場 合,レ ベ
ル 0に あ る頂 点 は木 の根 A だ け で あ り,そ の 発 生 確 率 は 1だか ら,明 らか に こ の条 件 は 満 た され る.レ ベ ル 1には 頂 点 B と C が 存 在 す る.B 応 す る様 相 の 発 生 確 率 は
に対
C に対応す る様相 の発生確率 は
で あ る か ら,そ の 合 計 は確 か に 1に な っ て い る.レ ベ ル 2 に は頂 点D,E, Fが
存 在 す る.例 え ば,頂 点 D に対 応 す る 様 相 の 発 生 確 率 は
で あ る.同 1/4,1/2で
様 に し て,頂 あ る か ら,そ
点E,Fに
対 応 す る 様 相 の 発 生 確 率 は,そ
れ ぞ れ,
れ ら の 合 計 は や は り 1 に な る.
変換 換
2.4.3
離 散Fourier 散Fourier変
Shorが
考 案 した 因数 分 解 の 量 子 ア ル ゴ リス ム に お い て 中心 的 な役 割 を果 た す
の が,次
の よ う な 離 散Fourier変
DFTと
略 す)で
あ る.DFTは
換(Discrete
1 ビ ッ トの 状 態 空 間 に 対 して 適 用 さ れ る,以
行 列 A で 表 現 さ れ る 変 換 で あ る.
この行 列 を ビ ッ ト 0を表 す状 態 ベ ク トル
に 適 用 し て み よ う.す
る と,
Fourier Transformation,以
下 下 の
と な る.こ
の 式 の 右 辺 は,状
態 ベ ク トル
と
を,等
しい 振 幅 で 重 ね合 わ せ た 状 態 を表 して い る.つ
ま り,右 辺 の 状 態 に あ る 1
ビ ッ トの 物 理 系 を観 測 す る と,そ れが 0で あ る こ とが ,確 率
で 観 測 され る.し た が っ て,そ の 物 理 系 が 1で あ る こ と も,同
じ確 率
で観 測 さ れ る. 次 に,行 列 A を ビ ッ ト 1を表 す 状 態 ベ ク トル
に 適 用 し て み よ う.す
と な る.こ
る と,
の 式 の 右 辺 は,状
態 ベ ク トル
を,絶 対 値 は 等 しい が 符 号 が 異 な る振 幅 で重 ね 合 わせ た状 態 を表 して い る.し か し,こ の 場 合 も右 辺 の 状 態 に あ る 1ビ ッ トの物 理 系 を観 測 す る と,そ れ が 0で あ る こ とが,確
率
で 観 測 さ れ,ま
た,そ
れ が 1 で あ る こ と も,同
じ確 率
で 観 測 さ れ る こ とに な る. 以 上 を ま と め る と,あ す る と,最 と,変
る ビ ッ ト に 行 列 A で 表 現 さ れ るDFTと
初 そ の ビ ッ ト に 0 が 書 き 込 ま れ て い よ う と,1
換 後 の ビ ッ ト を 読 め ば,0
の よ う な 性 質 が あ る た め,DFTは Flip)と
い う変 換 を適 用
が 書 き込 ま れ て い よ う
と 1が 等 し い 確 率 で 読 み 出 せ る わ け で あ る.こ 別 名,量
子 コ イ ン 投 げ(Quantum
Fair Coin
も呼 ば れ る.
さ て,最
初 に n 個 の マ ス 目 を 持 つ テ ー プ が 与 え ら れ,テ
に は 0 が 書 き 込 ま れ て い る と し よ う.こ 上 で 述 べ たDFT(量
子 コ イ ン投 げ)を
子 を 表 し た 計 算 木 が,図2.12に
図2.12の
ープのすべ てのマス 目
の n 個 の マ ス 目 に 対 して,左
適 用 して い く こ と を 考 え る.こ
か ら 順 に, の計 算 の様
示 さ れ て い る.
計 算 木 に お い て は,木 の 根 A に対 応 す る初 期 状 態 の 第 1ビ ッ ト(最
も左 側 の ビ ッ ト)にDFTを
適 用 した 結 果 が,木 の 第 1 レベ ル の 二 つ の 頂 点B,C
に対 応 す る様 相 と して 現 れ て い る.こ の う ち頂 点 B は,量 子 コ イ ン投 げ の 結 果,
図2.12
n ビ ッ トテ ー プ 上 のDFT
第 1 ビ ッ トの 値 が 0に な っ た様 相 に対 応 して お り,頂 点 C は,量 子 コ イン投 げ の 結 果,第
1ビ ッ トの 値 が 1に な った様 相 に対 応 して い る.さ ら に,頂 点 B の 様 相
の 第 2 ビ ッ トにDFTを お り,ま た,C 点F,Gに
適 用 した 結 果 得 られ る様 相 が,図 の 頂 点D,Eに
の様 相 の 第 2 ビ ッ トにDFTを
現 れて い る.例
適 用 した結 果 得 られ る様 相 が,頂
え ば,頂 点 E に対 応 した様 相 は,第
を適 用 した結 果 が 0で あ り,か つ,第 た 様 相 で あ る.以 下 同 様 に して,木
現 れて
2 ビ ッ トにDFTを の 各 頂 点 にDFTを
1ビ ッ トにDFT
適 用 した結 果 が 1で あ っ 適 用 した 結 果 の 様 相 が 対
応 して い る. 図2.12の 計 算 木 に は2n個
の葉 が あ るが,そ れ らの 葉 に は左 か ら順 に,000…0
(n 個 す べ て の マ ス 目 に 0が 書 き込 まれ て い る)か
ら111…1(n
個す べて のマ
ス 目 に 1が 書 き込 まれ て い る)ま で の 状 態 が 現 れ て い る.こ れ らの 状 態 は,す べ て等 しい 振 幅
を持 って い る こ とに 注 意 す る.す
な わ ち,n
番 に,量 子 コ イ ン投 げ(DFT)を
適 用 して い っ た結 果,最
す べ て の 状 態 が,等
2.4.4
終 的 に2n個
の可 能 な
しい 振 幅 で 重 ね 合 わ され た 状 態 が 得 られ た こ と を,図2.12の
計 算 木 は表 現 して い る.し か も,こ の2n個 の処 理(n
ビ ッ トテ ー プ の 左 側 の マ ス 目 か ら順
回 のDFTの
の 状 態 の重 ね 合 わ せ が, n ス テ ップ
適 用)で 得 られ て い る こ とが 重 要 な 点 で あ る.
量子並列計算
Deutschに る 点 は,QTMで
よっ て 考 案 され たQTMが,通
械 と最 も大 き く異 な
は 単 一 プ ロセ ッサ 上 で 任 意 の 並 列 度 の 並 列 計 算 が 行 え る 点 で あ
る(量 子 力 学 の 理 論 的 枠 組 み に従 え ば,無 簡 単 な 例 で 説 明 す る.z=f(x1,x2,…,xn)を な わ ち,z, x1,x2,…,xnの
の 値(0
限 の並 列 度 も許 され て い る). n 変 数 ブ ー ル 関 数 と す る.す
値 は 0 ま た は 1 で あ る と す る.異
X=(x1,x2,…,xn)とY=(y1,y2,…,yn)(X, に 対 し て,z
常 のTuring機
Yの
な る二つ の入力
各 成 分 は 0 ま た は 1)
ま た は 1)を 求 め る 必 要 が あ る と し よ う.
こ の場 合,通
常 は まずf(X)の
れ ば な らな い.し
計 算 す る の に 必 要 な時 間 の,お QTMで
値 を計 算 しな け
よそ 2倍 の 時 間 が か か っ て し ま う.
は,入 力 X と Y の 両 方 を 同 時 に符 号 化 した 入 力 を 用 意 す る こ とが
で き る.こ れ は実 際 に は,X QTMにX+Yを
と Y をある線形空 間内の点
X, Y と して 表 現 し,
入 力 す る こ とに相 当 す る.こ の 形 の 符 号 化 を, X と Y の量
子 重 ね 合 わ せ(quantum
superposition)と
す る通 常 の プ ログ ラ ム をQTM上 とf(Y)の
値 を計 算 し,そ の 後 にf(Y)の
か し,こ の よ う な計 算 を行 う と,f の 値 を 一 つ の 入 力 に 対 して
呼 ぶ.こ の 入 力 に対 して, f を計 算
で 走 らせ る と(注1),その 結 果,出 力 と してf(X)
量 子 重 ね 合 わせ が 得 られ る.こ の こ と を,も う少 し形 式 的 に述 べ よ う.
QTMは,実
際 に は f の 計 算 に対 応 す る線 形 変 換(Ufと
の と き,Ufの
呼 ぼ う)を 実行 す る.こ
線 形 性 か ら以 下 が 成 り立 つ.
Uf(X+Y)=Uf(X)+Uf(Y) た だ し,X
と Y の量 子 重 ね合 わせ をX+Yと
とf(Y)の
量 子 重 ね 合 わせ に相 当す る.こ の 計 算 にお い て は,f の 計 算 プ ログ ラ
ム(す
なわ ち線 形 変 換Uf)は
表 して い る.こ の 式 の 右 辺 がf(X)
1回 しか 実 行 され て い な い の で,こ
の計算 に要す
る時 間 は,f の 値 を 一 つ の 入 力 に 対 して 計 算 す る の に必 要 な時 間 の み で あ る.入 力 の 量 子 重 ね 合 わせ に 対 して行 わ れ る この よ うな計 算 を,量 子 並 列 計 算 と呼 ぶ. さ らに好 都 合 な こ と に は,前 節 で 示 した よ う にDFTを
用 い る と, QTMは
指
数 個 の 入力 の 量 子 重 ね合 わせ を線 形 時 間(n ス テ ップ)で 用 意 す る こ とが で きる. した が っ て,そ の 入 力 の 重 ね合 わ せ に対 して f の プ ロ グ ラ ム を 1回実 行 す れ ば, す べ て の 入 力 に 対 す る f の 値 の量 子 重 ね合 わせ が得 られ る. こ こ まで 読 まれ た 読 者 は,あ
ま りに も話 が うま過 ぎる と思 わ れ た だ ろ うが,現
在 の量 子 力 学 の枠 組 み に従 う限 り,こ こ まで の と こ ろ は一 応 問 題 な い.実 題 は そ の 後 で あ る.上 の よ うな 計 算 が 行 わ れ た後 に は,例 え ば,出 2n個
の f の 値f(X1),f(X2),…,f(X2n)が
て い る こ と に な る.こ (注1)QTMは
は,問
力テープ上 に
量 子 重 ね合 わせ の 状 態 で 印刷 され
こ で再 び,現 在 の 量 子 力 学 の 枠 組 み に従 う と,出 力 テ ープ
,通 常 のTuring機
械 が実 行 可 能な すべ て の プ ログ ラム を実 行 で きる.
か らの 値 の 読 み 出 しに強 い制 限 が 課 され て しま うの で あ る. 今 の 例 で い え ば,出
力 の 可 能 な 観 測 方 法 と し て は,例
に 対 し て,「f(Xi)=1か?」(Xi∈{0,1}n)を
え ば,あ
るi,1〓i〓2n
観 測 す る こ と が で き る が,こ
の
場 合, 1.実 際 にf(Xi)=0の
と き は,上
の 観 測 結 果 は 確 率 1 でNOと
2.実 際 にf(Xi)=1の
と き は,上
の 観 測 結 果 は 確 率1/2nでYESと
な り, なる
こ と し か 保 証 で き な い.
この こ とは,QTMは
すべ て の 入力 値 に対 す る計 算 を効 率 よ く行 っ た の に,そ
の 結 果 を我 々人 間が 効 率 よ くは読 み 出 せ ない と い うジ レ ンマ を表 して い る.一 方, 因 数 分 解 問 題 や 離散 対 数 問 題 の よ うに,QTMが
通 常 のTMよ
り も高 速 に解 け そ
うな 問 題 が す で に知 られ て い る が,そ の よ うな問 題 は,量 子 並 列 計 算 と適 当 な観 測 方 法 とを う ま く組 み合 わせ れ ば,効 率 よ く解 け る よ うな構 造 を持 っ て い る こ と が わ か る.
2.4.5
2 段Fourier変
換
上 で 述 べ た量 子 並 列 計 算 の メカ ニ ズ ム を用 い て,図2.12の 2n個
の 状 態 の 重 ね 合 わせ 上 で,な
計 算 木 の 葉 に現 れ る
ん らか の 計 算 を行 う こ と を考 え よ う.例 え ば,
こ の計 算 木 の 葉 に現 れ る 様相 の 重 ね 合 わ せ が,
X1+X2+…+X2n
と 表 現 で き た と し よ う.た 目 の 葉 に 対 応 し たTMの こ こ で は,TMの
だ し,Xi(1〓i〓2n)は,こ 様 相 を 表 現 す る ベ ク トル と す る.
様 相 を,そ
を n ビ ッ トの 2進 列 と す る.さ 値 の 割 当 て と解 釈 し,あ
の 計 算 木 の 左 か ら i番
の テ ー プ の 内 容 と 同 一 視 して,各Xi(1〓i〓2n) ら に,こ
れ を ブ ー ル 変 数x1,x2,…,xnに
対す る
る n 変 数 ブ ー ル 関 数 f の 値 を 求 め る こ と を 考 え よ う.f
の 値 を 求 め る こ と に 対 応 す る ユ ニ タ リ変 換 をUfで
表 す と,Ufの
線 形 性 か ら,以
図2.13
下の 関
DFTを
用 いた 量子 並列 計 算
式 が 得 られ る. Uf(X1+X2+…+X2n)=Uf(X1)+Uf(X2)+…+Uf(X2n)
こ の 式 の 右 辺 は,f(X1),…,f(X2n)の
値 を 求 め た 後 のTuring機
械 の2n個
の様
相 の 重 ね 合 わ せ を 表 現 し て い る.以
上 の 計 算 の 様 子 が,図2.13に
さ ら に 計 算 を 続 け よ う.図2.13の
葉 に 現 れ て い る 各 様 相 の 最 も左 側 の ビ ッ トか
ら,図2.12の
と き と ま っ た く 同 様 に,順
の 様 子 が,図2.14に
示 さ れ て い る.読
不 思 議 に 思 わ れ る か も し れ な い が,実 考 案 さ れ た 2 段 フ ー リ エ 変 換(Fourier が 離 散 対 数 問 題 に 対 す るShorの Shorは,こ
番 にDFTを 者 は,な
は,こ
示 さ れ て い る.
適 用 し て み よ う.こ
の計算
ぜ こ の よ う な 計 算 を 行 うの か と
の 計 算 方 法 はD.R. Simonに
Twice)と
呼 ば れ る も の で,こ
ア ル ゴ リ ズ ム の 基 礎 と な っ て い る[49].そ
の 離 散 対 数 問 題 に 対 す る ア ル ゴ リ ズ ム を 少 し 変 形 す る こ と で,因
よ って の手法 し て, 数分
解 問 題 に 対 す る 量 子 ア ル ゴ リ ス ム を 得 た の で あ る[48]. 2 段 フ ー リ エ 変 換 の 結 果 得 ら れ る 図2.14の て い る.関
数 f が 1 対 1 の と き は,各(X,Y),
計 算 木 は,次
の よ うな 性 質 を持 っ
X,Y∈{0,1}nに
対 し,各
組
図2.14
2段
(Y,f(X))は
す べ て異 な る.よ っ て計 算結 果 を観 測 す る と,各 組(Y,f(X))が
等
確率 1/22n
で 観 測 され る.す な わ ち,計 算 木 の 葉 の 部 分 で は 干 渉 は ま っ た く起 こ らな い. しか し,f が 1対 1で ない 場 合 に は,組(Y,f(X))の た め,そ
中 に等 しい もの が現 れ る
の よ うな箇 所 で 干 渉 が起 き る こ とに な る.こ の 場 合,所
て い るf(X)に
望 の 結 果 を与 え
つ い て は 正 の 干 渉 が 起 こ る よ うに し,そ うで は な いf(X)に
つい
て は負 の 干 渉 が 起 こ る よ うに して,所 望 の 結 果 が 得 られ る確 率 を増 幅 させ よ う と い うの が,Shorの
2.4.6
一 連 の 量 子 ア ル ゴ リズ ム の 設 計 方 針 で あ る.
量 子 k 面 サ イ コロ投 げ
本 節 で は,因
数 分 解 問 題 に 対 す るShorの
流 儀 で 直 観 的 に 説 明 す る.Shorの 拡 張 し た,図2.15の Roll)を
ア ル ゴ リ ズ ム の 動 作 原 理 を,Simonの
ア ル ゴ リ ズ ム で は,DFT(量
子 コ イ ン投 げ)を
よ う な 量 子 k 面 サ イ コ ロ 投 げ(Quantum
k-sided
Die
用 い る.
オ イ ラー の φ 関 数 は 自然 数 上 で そ の 値 が 定 義 され,自 然 数 N に対 す る φ(N) の 値 は,「N と互 い に素 な N 以 下 の 整 数 の個 数 」 と定 義 され る. a と N が 互 い に 素 の と き,a
のmod
Nの
aγ ≡1mod
オ ー ダ γ と は,
N
を満 た す 最 小 の 整 数 γ の こ と をい う.a と N が 互 い に素 の と き,a のmodN
図2・15
量子 k 面サ イ コロ投 げ
図2.16
の オ ー ダ を発 見 で きれ ば,N
Shorの 因 数分 解 ア ルゴ リズムの 動作
の 因 数 分 解 が 比 較 的 簡単 に行 え る こ とが,整 数 論 の
結 果 と して 知 られ て い る(詳 細 は本 書 の 第 6章 参 照).実 ラ ンダ ム に選 ば れ た 整 数 a に対 し,a のmod Nの
際,Shorが
示 した の は,
オ ー ダ γ を,小 さ な誤 り確 率
で 多 項 式 時 間 以 内 に発 見 す る量 子 ア ル ゴ リズ ム で あ る. い ま,整
数 N
関 数 φ(N)の
値 が わ か っ て い た と し よ う(後
こ と は な い).こ が 図2.16で
を 因 数 分 解 し た い と き に,QTMの
の 仮 定 の も と で,Shorの
あ る.た
だ し,図2.16の
処 理 に 先 立 っ て, Eulerの
で も 述 べ る が,実
φ
際 に は この よ うな
ア ル ゴ リズ ムの 動 作 を説 明 して い るの
計 算 木 は,a
のmod
Nの
オ ー ダ γ を求 め
る 計 算 に 対 す る も の で あ る. よ く見 て い た だ く と わ か る が,こ
の 図 は,図2.14の
2段Fourier変
換の計算木
にお い て,
1.DFTに
よ る 二 股 の 分 岐 が,量
岐 の 置 き換 え られ,
子 φ(n)面 サ イ コ ロ投 げ に よ る φ(n)個 の 分
2.さ ら に,量
子 並 列 計 算 を行 う関 数 f と して,f(a,x)=axと
い う関 数 が 具
体 的 に指 定 され た も の で あ る. こ の と き,a か も,γbが
と N が 互 い に 素 で あ り,γ が a のmodNの
φ(N)の
起 こ す.([a,b,x]と る.こ
こ で は,テ
倍 数 な ら ば,様
い う表 記 は,テ
相[a,b,x]に
対 応 す る葉 同士 は 正 の 干 渉 を
ー プ の 内 容 が “a,b,x” で あ る こ と を 表 して い
ー プ の 内 容 と様 相 を 同 一 視 し て い る こ と に 注 意.)し
以 外 の 様 相 に 対 応 す る 葉 同 士 は 負 の 干 渉 を起 こ し,そ る.し
オ ー ダ で あ り,し
た が っ て,図2.16の
プ を 観 測 す る と,あ
か し,そ
れ らの振 幅 の 合 計 は 0に な
計 算 木 で 表 さ れ る 計 算 が 終 了 し た 後 で,QTMの
る 整 数 k に 対 し γb=kφ(N)を
関 係 式 か ら γ を 求 め る こ と が で き る.こ 越 え る こ と な の で 省 略 す る.詳
実 は,上 記 の ア ル ゴ リズ ム はShorの
テ ー
満 た す b が 観 測 で き,こ
の こ と の 詳 細 な 理 由 は,本
細 に つ い て は,第
れ
の
章 の レベ ル を
6章 を 参 照 さ れ た い.
ア ル ゴ リズ ム を非 常 に単 純 化 して 説 明 し
た もの で あ る が,以 下 の よ うな 問 題 点 が あ る. ● まず,整 数 N の 因 数 分 解 に先 立 って,φ(N)の が,そ
値 を知 ら なけ れ ば な らない
の 値 の 計 算 を多 項 式 時 間 で行 う方 法 は知 られ て い ない.
● さ ら に,量 子 φ(N)面 サ イ コ ロ投 げ は,QTMを
用 い て も多 項 式 時 間 で行
え る か ど うか は わ か ら ない. し たが っ て,上 記 の 簡 略 版 の ア ル ゴ リズ ム を そ の ま ま用 い た の で は,QTM上
で
因 数 分 解 が 多項 式 時 間 で 行 え る こ と は示 せ そ う も ない. 実 際,Shorが
行 っ た の は,こ の 簡 略 版 の アル ゴ リズ ムの 動 作 を確 率 的 に近 似 す
る こ とで あ っ た.そ の 結 果,若 干 の誤 り確 率 を伴 うが,因 数 分 解 を多 項 式 時 間で 行 え る量 子 ア ル ゴ リズ ム を設 計 す る こ とに成 功 した.し か も,こ の 誤 り確 率 は い く らで も小 さ くす る こ とが で きる.Shorが
行 った 近 似 の 方 法 は,本 書 の 第 6章 で 詳
細 に説 明 す るの で,興 味 の あ る方 は そ ち ら を ご参 照 い た だ きた い.し か し,Shor の 因 数 分 解 ア ル ゴ リズ ム の 動 作 原 理 は,上 記 の 簡 略 版 ア ル ゴ リズ ム と基 本 的 に同 じ もの で あ る.
第 3章 量 子 コ ン ピ ュ ー タの 実 現 に
向けて 本章 で は,前 章で 概 略 を紹 介 した量 子 コ ンピュ ー タの,実 現 に向 けて の研 究 を紹 介す る.量 子 コ ン ピュー タの 実現 に関 す る研 究 は,ま だ始 まっ たば か りだが,本 章 で は,そ の よ うな研 究 で何 が問題 にな っ てい るの か を列 挙 す る こ とに 主眼 を置 い た(量 子 コ ン ピュー タの 理論 にお け る未 解 決問題 に つい ては,第 4章以 降 で述 べ る).こ の 分野 の研 究 は現 在進 行 中で あ り,日 々新 しい論 文 が発 表 され てい る.そ う した最 新情 報 を得 る には,イ ンタ ー ネ ッ トを利用 す るの が最 も効 率的 で ある.そ こで,本 章 の 最後 に,量 子 コ ンピュー タ関連 の論 文 が多 数登 録 されて い るWWWサ
イト
のア ドレス を掲 載 したの で,ご 活用 いた だ きたい.な お,本 章の 記 述の 多 くの 部 分 は,文 献[35] を参 考 に して い る.
3.1
量子情報
情 報 量 の 単 位 は ビ ッ トで あ る.1 ビ ッ トの 情 報 は,二 つ の選 択 肢YesとNoの 別 を 表 す.す
区
な わ ち,情 報 は 離散 的 な単 位 の 集 ま り と して 表 現 され る.一 方,前
に も述 べ た よ うに,量 子 力 学 にお い て は 原 子 のエ ネ ル ギ ー ・レベ ル は 離 散 的 に な る.量 子 コ ン ピ ュ ー タの 基 本 的 な発 想 は, 今 日の デ ジ タ ル情 報 処 理 で 用 い られ て い る離 散 的 性 質 を,量 子 力 学 に お け る(特 殊 な)離 散 的 性 質 で 表現 し よ う と い う こ と で あ る.
現 在 のデ ジ タル ・コ ン ピュー タで は,キ
ャパ シ タ内 の極 板 間 の 電圧 に よ り 1ビ ッ
トの 情 報 を表 現 して い る.す な わ ち,充 電 され た キ ャ パ シ タは 1 を表 現 し,充 電 さ れ て い な い キ ャパ シ タは 0 を表 現 して い る と考 え る.こ れ と同様 に,水 素 原 子
(a)
(b) 図3.1
水 素原 子 へ の情報 の 記憶. (a)情 報 の 反 転, (b)情 報 の 読 み 出 し.
の列 も複 数 の ビ ッ ト を保 持 す る こ とが で き る.こ の 場 合 に は,基 底 状 態 に あ る原 子 は 0 を表 現 し,励 起 状 態 に あ る原 子 は 1を表現 して い る と考 え る(図3.1参 この よ うな 形 で 水 素 原 子 を用 い,コ
ン ピ ュ ー タを 実 現 す る た め には,水
照).
素原子 に
貯 え ら れ た情 報 に対 して,読 み 出 し,書 き込 み,演 算 が 行 え な け れ ば な らな い. 量 子 系 に情 報 を書 き込 む方 法 を初 め て 示 した の は,ノ I.I.Rabiで
ーベ ル物 理 学 賞 受 賞 者 の
あ っ た.彼 の 方 法 を水 素 原 子 に適 用す る と以 下 の よ う にな る.
エ ネ ル ギ ー ・レベ ルがE0の
基 底 状 態 に あ る水 素 原 子 A に, 0 を書
き込 む 場 合 に は何 も行 わ な くて よい が,1 を書 き込 む場 合 に は,A よ り高 い エ ネ ル ギ ー 状 態E1に こ れ を 行 う に は,E1-E0に を,A
を
励 起 させ る.
等 しい量 の エ ネ ルギ ー を持 つ 光 子 か ら な る レー ザ 光
に 注 げ ば よ い.
も し レーザ 光 が 適 当 な強 さで適 当 な 時 間 だ け 照 射 され れ ば,A る に 従 っ て,基 底 状 態E0か
ら励 起 状 態E1に
は 光 子 を吸 収 す
徐 々 に移 行 す る.一 方, A が す で
に励 起 状 態E1に
あ る 場 合 に は,同
じ レーザ 光 が A に 光 子 を放 出 させ る の で,A
は基 底 状 態E0に
移 行 す る.す な わ ち,こ の レー ザ 光 に よ り,水 素 原子 A が 保持
す る ビ ッ トが 反 転 さ れ る. A が 保 持 す る情 報 を 0か ら 1に 反 転 させ る の に 要 す る時 間 を t と し よ う.も し上 の 意 味 で 適 切 な レーザ 光 が,時 間t/2だ
け 照 射 され る と,A
は,同
じ振 幅 を
持 っ た,0 に対 応 す る 波 と 1に対 応 す る波 の 重 ね 合 わ せ に対 応 した状 態 に な る. この と き,A が 保 持 して い る キ ュ-ビ
ッ ト(quantum
bit)は,「 半 分 だ け 反 転 さ
れ て い る」 と考 え る こ とが で きる.こ れ に対 し,通 常 の ビ ッ トは 0ま た は 1 を表 す こ と しか で き ない. 量 子 系 か らの情 報 の 読 み 出 し も,上 で述 べ た反 転 と同 様 に して行 う こ とが で き る.E2を,
E1よ
り高 い が,よ
か ら情 報 を読 み 出 す に は,E2-E1に に照 射 して,A E2に
を状 態E2に
励 起 さ れ る が,E2は
り不 安 定 な水 素 原 子 の エ ネ ル ギ ー状 態 とす る. A 等 しい 量 の エ ネ ル ギ ー を持 つ レー ザ 光 を A.
移 行 させ れ ば よい.A
は,状 態E1に
不 安 定 なエ ネ ル ギ ー 状 態 な の で,A
あ れ ば,状 態 は す ぐ に光 子 を
放 出 して 崩 壊 し状 態Elに
戻 る.一 方, A が 基 底 状 態E0に
レ ーザ 光 を照 射 して も何 も起 こ らな い.も に あ れ ば,A
あ れ ば,上 の よ うな
し,A が 「半 分 だ け 反 転 さ れ た 」状 態
が 光 子 を放 出 して 1を保 持 して い た こ と を示 す確 率 と,光 子 を放 出
せ ず に 0 を保 持 して い た こ と を示 す 確 率 は,と
もに1/2で
あ る.
量子 回路
3.2 3.2
一 般 に 電 気 回 路 は,多 数 の 論 理 ゲ ー ト(素 子)か
ら構 成 され て い る.通 常,論
理 ゲ ー トは 数 種 類 存 在 し,そ の 種 類 ご とに,各 ゲ ー トが 行 うべ き単 純 な演 算 が 定 め られ て い る.回 路 に入 力 が 与 え られ る と,入 力 が 到 達 した ゲ ー トか ら順 に,そ の ゲ ー トが行 うべ き演 算 を行 っ て い き,最 終 的 に 回 路 全 体 が 複 雑 な計 算 を行 うよ う に設 計 され て い る. 通 常 の コ ン ピ ュ ー タ を 実 現 す る の に 用 い ら れ て い る 論 理 ゲ ー ト と し て は,AND, OR, NOTゲ
ー ト な ど が あ る.例
種 類 の ゲ ー ト を用 い れ ば,任 路 を構 成 す る こ と が で き る.こ AND…
え ば, ANDとNOT,ま
意 のTuring機
た はORとNOTの
械 の 計 算(を シ ミ ュ レ ー シ ョ ン す る 回
れ ら の 論 理 ゲ ー トの 動 作 は,以
こ の 論 理 ゲ ー ト は 2 入 力 1出 力 で あ る(図3.2(a)参 に お い て は,二
つ の 入 力 ビ ッ トx1
(a)
図3.2
通常 の論 理 ゲ ー トの動作. (a)ANDゲ
2
とx2の
下 の と お りで あ る. 照). ANDゲ
ー ト
値 が と も に 1 な ら ば,出
力 ビッ
(b)
ー ト, (b)ORゲ
(c)
ー ト,
(c)NOTゲ
ー ト.
トyの OR…
値 も 1に な るが,そ
れ 以外 の 入 力 に対 して は y の 値 は 0 に な る.
こ の 論 理 ゲ ー ト も 2 入 力 1出 力 で あ る(図3.2(b)参 お い て は,二
つ の 入 力 ビ ッ トx1とx2の
y の 値 も 0 に な る が,そ NOT…
値 が と も に 0 な ら ば,出
ー トに 力 ビット
れ 以 外 の 入 力 に 対 し て は y の 値 は 1 に な る.
こ の 論 理 ゲ ー トは 1入 力 1出 力 で あ り,ビ ゲ ー ト に お い て は,入
照).ORゲ
ッ トの 反 転 演 算 を行 う.NOT
力 が 1 の 場 合 に は 出 力 は 0 に な り,入
に は 出 力 は 1に な る(図3.2(c)参
力 が 0の 場 合
照).
と こ ろ で,前 節 で も述 べ た よ う に,量 子 計 算 は ユ ニ タ リ変 換 と呼 ばれ る線 形 変 換 で 表 現 され る が,ユ
ニ タ リ変換 は必 ず 逆 変 換 を持 つ.し
た が って,量 子 計 算 を
実 現 す る た め に は,逆
向 きに も動 作 す るゲ ー トしか 使 え な い.と
こ ろが,上
べ た 通 常 の 3種 類 の論 理 ゲ ー トの うち,逆 向 きに も動 作 可 能 な の はNOTゲ の み で あ り,ANDゲ す な わ ち,ANDゲ
ー トとORゲ
ート
ー トにお い て は逆 向 きの計 算 は実 行 で きな い.
ー ト(ま た はORゲ
ー ト)の 出力 ビ ッ ト y の 値(0 ま た は 1)
が 与 え られ て も,入 力 ビ ッ トx1,x2の Deutsch[16]やYao[54]ら
で述
値 が 何 で あ っ たか を求 め る こ とはで き ない.
の 研 究 に よ っ て,量
子Turing機
械 の動作 は量子 回
路 で シ ミュ レー シ ョ ンで きる こ とが わ か って い る.最 近,量 子 回路 を実 現 す る た め の量 子 論 理 ゲ ー トにつ い て盛 ん に研 究 が 行 わ れ て い るが,現 在 まで に,例 え ば, 以 下 の よ うな 量 子 論 理 ゲ ー トが 考 案 され て い る.な お,量 子 論 理 ゲ ー トの 各 入 出 力 は,一 制 御NOT…
つ の キ ュ ー ビ ッ トに対 応 してい る. こ の ゲ ー ト は 2入 力 2 出 力 で あ る(図3.3(a)参
場 合 に つ い て 説 明 す る と,制 値 が 0 な ら ば,入 の 値 と な る が,x1値 す な わ ち,x1=1の
御NOTゲ
ー ト に お い て は,入
力 の 第 2 ビ ッ トx2の が 1 な らば,x2の と き に,x2の
の 場 合 に お い て も,y1=x1で
照).最
も単 純 な
力 ビ ッ トx1の
値 が そ の ま ま 出 力 の 第 2 ビ ッ トy2 値 が 反 転 さ れ た 値 がy2の
否 定 がy2に
代 入 さ れ る.な
値 と な る. お,い
ずれ
あ る.
ユ ニ タ リ変 換 … この ゲ ー トは 1入 力 1出 力 で あ り,入 力 に対 して 指 定 され たユ
(a) 図3.3
(b)
量子論 理 ゲ ー トの 動作. (a)制 御NOTゲ
ニ タ リ変 換 U を 行 う(図3
.3(b)参
ー ト, (b)ユ ニ タ リ 変 換 ゲ ー ト.
照).た
だ し,こ
の ユ ニ タ リ変 換 U は ,
行 列 式 が 1で あ る よ う な,2 行 2列 の ユ ニ タ リ行 列 で 表 現 さ れ る も の で あ る .
上 の例 か ら もわ か る よ うに,計 算 の 可 逆 性 を保 証 す る た め に,量 子 論 理 ゲ ー ト の 入 力 数 と出 力 数 は一 致 して い な け れ ば な らな い .原 理 的 には,量 子Turing機 の す べ て の動 作 は,制 御NOTゲ
械
ー ト とユ ニ タ リ変 換 ゲ ー トを用 い て 構 成 した 量
子 回 路 で シ ミュ レ ー シ ョ ンす る こ とが で きる[6].こ の結 果 は,任 意 の 量 子 回路 が た か だか 2入 力 2出力 の 量 子 論 理 ゲ ー トで構 成 可 能 で あ る こ と を示 して お り,大 変 重 要 で あ る.量 子 論 理 ゲ ー トを用 い た 量子 回 路 の 構 成 法 に 関 す る わ か りやす い 解 説 が,[28]に
あ る.
通 常 の コ ン ピ ュー タの 場 合 と同様 に,量 子 論 理 ゲ ー トを ワ イヤ で 結 合 す れ ば,量 子 回路 を作 る こ とが で きる.し か し,後 で述 べ る よ うに,「量 子 ワ イヤ 」 を構 成 す る こ とは非 常 に 難 しい こ とが 指 摘 され て い る.
3.3
量 子 系 の シ ミ ュ レー シ ョ ン
今 の とこ ろ は,数 ビ ッ トの メモ リ上 で の 量 子計 算 しか行 え な いが,近 い 将 来,数 十 な い し数 百 ビ ッ トの メモ リ上 で の 量 子 計 算 が行 え る可 能 性 が あ る と い わ れ て い
る.現
在 の コ ン ピ ュ ー タ は 何 百 万 ビ ッ ト も の メ モ リ を 持 っ て い る の で,こ
つ ま ら な い と 考 え ら れ る 読 者 も 多 い だ ろ う.と 用 で き な く て も,量
こ ろ が 実 際 に は,1
れで は
ビ ッ ト しか 利
子 コ ン ピ ュー タ に は現 在 の コ ン ピ ュ ー タが行 え な い計 算 を実
行 で き る 可 能 性 が あ る.
0 と 1の 状 態 が 等 しい 振 幅 で 重 ね 合 わ され た 状 態 に あ る 原 子 を考 え,そ れ が 表 現 す る ビ ッ トが 0で あ る か 1で あ る か を,そ れ を 蛍 光 させ る こ と に よ り決 定 す る こ とを考 え よ う.こ の 場 合,2 回 に 1回 は,そ の 原 子 は 光 子 を放 出す る の で,そ の ビ ッ トは 1で あ る こ とが わ か る.そ
うで な け れ ば,光 子 は 放 出 され ない の で,そ
の ビ ッ トは 0で あ る こ とが わ か る.す な わ ち,こ の 原 子 が 表 現 す る ビ ッ トを観 測 す る と,1 が 正確 に確 率1/2で
読 み 出 せ る.こ の よ うな ビ ッ トをラ ン ダ ム ・ビ ッ
ト とい う.現 在 の コ ン ピュ ー タを用 いて,理 想 的 な ラ ンダ ム ・ビ ッ トを作 り出 す 方 法 は知 られ て い な い.も
し量 子 コ ン ピュ ー タ を用 い て,理
想 的 な ラ ンダ ム ・ビ ッ
トを作 り出す こ とが で きれ ば,幅 広 い応 用 が 期 待 で き る で あ ろ う. 一 方,S.Lloydは,そ
れ ほ ど多 くの ビ ッ ト数 を使 わ ない で,量 子 コ ン ピュ ー タ
で任 意 の 量 子 系 の 動 作 が シ ミュ レー シ ョ ンで き る こ と を指 摘 して い る.こ の 量 子 コ ン ピ ュ ー タが 量 子 系 の 時 間 発 展 を記 録 す るの に要 す る ス テ ップ 数 は,そ の 系 の サ イズ に比 例 す る.Feynmanが
指 摘 した よ うに,量 子 系 を現在 の コ ン ピュ ー タで
模 倣 す る に は,一 般 に,そ の 系 の サ イズ に 関 す る指 数 関 数 的 な ス テ ップ 数 が 必 要 に な る. Shorの
ア ル ゴ リズ ムで 動 作 す る量 子 コ ン ピュ ー タが,因 数 分 解 の 速 度 にお い て
現 在 の ス ーパ ー コ ンピ ュー タ を上 回 るた め に は,数 百 ビ ッ トの メモ リを数 千 ス テ ッ プ に わ た って 制 御 す る必 要 が あ り,そ の 間 中,コ ば な らな い.こ を,Landauerは し か し,量 に は,わ
ヒー レ ン ト状 態 を維 持 しな け れ
の よ う な計 算 を行 う量 子 コ ン ピュ ー タの 実 現 が 非 常 に難 しい 理 由 幾 つ も指 摘 して い る.
子 系 の シ ミュ レー シ ョン にお い て現 在 の コ ン ピ ュ ー タ を しの ぐ た め
ず か 数 十 ビ ッ トの メ モ リ を数 十 ス テ ップ に わ た っ て 制 御 す る こ と が 要 求
さ れ る だ け で あ る.し
た が っ て,量
子 コ ン ピ ュ ー タ を 用 い て,例
重 粒 子 の 量 子 状 態 を シ ミ ュ レ ー シ ョ ン し,そ
え ば,未
知 の多
の 性 質 を 解 明 す る こ と な ど は,近
い
将 来 に達 成 で き るか も しれ な い 一 つ の 目標 で あ る.
3.4
量 子 コン ピュ ー タの実 現 に お け る問題 点
本 節 で は,量 子 コ ン ピュ ー タ を実 現 し よ う とす る 際 に,克 服 しな け れ ば な らな い 問 題 点 を 簡 単 に列 挙 して お く. 1.量 子 ワ イ ヤ の 構 成 …
量 子 論 理 ゲ ー トを ワ イヤ で 結 合 す れ ば,量
子 コン
ピュ ー タを作 る こ とが で き る はず で あ る.し か し,「量 子 ワ イヤ 」 を構成 す る こ とは 非常 に難 しい.現 在 の コ ン ピュ ー タで 用 い られ て い る ワ イヤ は,あ る ゲ ー トか ら他 の ゲ ー トに電 気 信 号 を伝 達 す る単 な る金 属 線 で あ る.一 方, 量 子 ワ イヤ を実 現 す る た め に は,電 子 と陽 子 を思 い の ま ま に移 動 させ る た め に,原 子 を分 解 で きな け れ ば な らな い し,ま た そ の後 で,粒 子 の ス ピ ン な ど をす べ て 乱 す こ と な く,原 子 を再 構 成 す る こ とが で きな け れ ば な らな い.こ れ は非 常 に難 しい こ とで あ る. 量 子 論 理 ゲ ー トを接 続 す る た め の,別
の 方 法 を提 案 して い る研 究 者 もい
る.光 フ ァ イバ ー や 空気 の 中 を通 過 す る光 子 は,あ る ゲ ー トか ら他 のゲ ー ト に情 報 を運 ぶ こ とが で きる.カ
リフ ォル ニ ア工 科 大 学 のH.J.Kimbleら
の
グ ル ー プ は,光 子 を 一 つ の 原 子 と と も に微 少 な体 積 の 中 に閉 じ こめ て,通 常 は小 さな 光 子 間 の 非 線 形 相 互 作 用 を増 強 す る こ とに成 功 した.Kimbleら は,こ の 作 用 を用 いて,量 子 論 理 ゲ ー トを構 成 す る方 法 を検 討 して い る.こ の種 の 量 子 光 ゲ ー トか ら構 成 され た量 子 コ ン ピ ュ ー タは,計 算 速 度 が速 く, しか も,コ
ヒー レ ンス を破 壊 す る よ う な環 境 か らの 影 響 を受 け付 け に くい
と期 待 され て い る.し か し,こ の 実 現 方 法 も非 常 な 困 難 を と もな う と考 え られ て い る. ワ イ ヤ リ ン グ の 問 題 に 対 す る 別 の 試 み も あ る.ス Mancha大
学 のJ.I.Ciracと,Innsbruck大
ラ ップ 内 で 量 子 ビ ッ ト を孤 立 させ,外
ペ イ ン のCastilla-La
学 のP.Zollerは,イ 界 の い か な る 影 響 か ら も,量
を 隔 離 す る た め の 方 法 を 検 討 して い る.ま
た,NISTのD.J.Winelandの
オ ン ・ト 子 ビッ ト
グ ル ー プ は,イ オ ン に よ って 符 号 化 され た ビ ッ ト上 で 演 算 を行 う量 子 コ ン ピ ュ ー タの 実 現 につ い て検 討 して い る. 2.
デ コ ヒ ー レ ン ス の 問 題 … 量 子 系 の 状 態 の 重 ね 合 わ せ は,環 境 が そ の 系 の 状 態 に影 響 を与 え な い 場 合 に の み 保 存 され る.量 子 コ ン ピュ ー タ とい う系 は,数 百 万個 以 上 の 原 子 か ら構 成 され る可 能性 が あ る が,そ
れ らの 原 子 の
うち の た だ 一 つ で も乱 さ れ て 量 子 コ ヒ ー レ ンス が 破 壊 され る と,相 互 作 用 を 及 ぼ し合 っ て い る量 子 系 が,ど 態 を保 て るか は わ か らな い.一
の くら い の 時 間,真
方,Shorら
は,あ
の量 子 重 ね 合 わせ 状
る程 度 の デ コ ヒ ー レ ンス
に直 面 して も,彼 の ア ル ゴ リズ ム が 正 し く動 作 す る こ とを 示 して い る.こ の よ うな コ ヒー レ ンス とデ コ ヒー レ ンス の 問 題 に つ い て考 察 して お くこ と は,量 子 コ ン ピ ュ ー タの 設 計 に あ た っ て大 変 重 要 で あ る. 3.
誤 り訂 正 … 量 子 コ ン ピュ ー タの実 現 に 関す る も う一 つ の 深 刻 な問 題 は,誤 り訂 正 で あ る.一 般 に情 報 処 理 シス テ ム は,ビ
ッ トを ラ ン ダ ム に反 転 して
し ま う ノ イズ に敏 感 で あ る.通 常 の 誤 り訂 正 法 に お い て は,ビ して,そ
れ が 誤 りか ど う か を検 査 す るが,こ
ッ ト を観 測
の よ うな 方 法 を用 い る と,量
子 コ ン ピュ ー タ はデ コ ヒ ー レ ン ト状 態 に 陥 っ て し ま う.も し効 果 的 な 誤 り訂 正 が行 え な い と,た
と え量 子 コ ン ピュ ー タが 実現 で きた と して も,多
くの
メモ リ を必 要 とす る計 算 を長 時 間 に わ た っ て行 え な い可 能 性 が あ る .そ の よ うな わ け で,最 近,量
3.5
子 誤 り訂 正 に 関 す る研 究 が 盛 ん に行 わ れ て い る.
研 究の ための情 報源
量 子 計 算 に 関 す る論 文 の 多 くは,論 文 誌 に 掲 載 され る前 に,WWWサ 登 録 され る こ とが 多 い.一
イ トに
般 に,そ の よ うな サ イ トか ら論 文 を取 っ て きた 方 が,
論 文 誌 へ の 掲 載 を待 つ よ り もは るか に 速 く情 報 に ア ク セ ス で きる.そ
こ で,ま ず
量 子 計 算,量 子 暗 号,量 子 通 信 な ど に 関 す る情 報 を提 供 して い る 主 な 公 的 機 関 の WWWサ
イ トのURLア
ド レス を紹 介 す る.
最 も豊 富 な情 報 を提 供 して い るの は,
http://xxx.lanl.gov/archive/quant-ph Los Alamos
で あ る.こ
National
Laboratoryの
の ア ー カ イ ブ か ら は,新
て も ら う こ と が で き る.そ
量 子 物 理 学 ア ー カ イブ
た に 登 録 さ れ た 論 文 の ア ブ ス トラ ク トを送 っ
の た め に は,
quant-ph@xxx.lanl.gov
に 電 子 メ ー ル を 打 て ば よ い が,そ
の 際,subjectラ
イ ン に,
subscribe
と書 き,本
文 は 空 に し て お く.こ
の よ う に す る と,そ
の メー ルの 差 し出 し人 の 電
子 メ ー ル ア ド レ ス が 先 方 の メ ー リ ン グ リ ス ト に 登 録 さ れ,以 ス ト ラ ク ト が 送 ら れ て く る よ う に な る.た 文 数 は,平 で も,か
だ し,こ
均 し て 日 に 数 件 程 度 に な る の で,こ
後,新
着論文 のアブ
の ア ー カ イブ に 登 録 さ れ る 論
こ か らの 情 報 を フ ォロ ー す るだ け
な り 骨 が 折 れ る.
こ の ほ か の サ イ ト と して は,以
下 の も の が あ る.
http://eve.physics.ox.ac.uk/QChome.html 量 子 計 算,量
子 暗 号 に 関 す るOxford大
学の ホームペ ージ
http://aerodec.anu.edu.au/ qc/index.html 量 子 計 算 に 関 す るAustralian
National
Universityの
ホ ー ム ペ ー ジ
http://feynman.stanford.edu/qcomp/ Stanford大
学 の 量 子 計 算 ア ー カ イブ
こ こで 紹 介 したサ イ トに は,量 子 計 算 に関 す る計 算 機 科 学 寄 りの 論 文 と,物 理 寄 り の 論 文 の 両 方 が 登 録 さ れ て い る.ま た 最 近 は,量 子 計 算 な ど に関 す る個 人 の ホ ー ム ペ ー ジ も多 数 設 け ら れ て い る の で,興 味 の あ る方 は文 献[14]を 参 照 され たい. 量 子 計 算 に 関 す る理 論 計 算 機 科 学 の 論 文 は,上 の サ イ トの ほか に,以 下 の 国 際 会 議 のProceedingsに
も毎 回2∼3件
程 度 が 掲 載 され て い る.
ACM
Symposium
ACMの IEEE
of Computing
計 算 理 論 に関 す る シ ンポ ジ ウ ム
Symposium
IEEEの
on Theory
on Foundations
of Computer
Science
計 算 機 科 学 基 礎 理 論 に 関 す る シ ンポ ジ ウ ム
ま た,量 子 計 算 に 関 す る物 理 寄 りの 論 文 が 数 多 く発 表 さ れ る 国 際 会 議 に は,以 下 の もの が あ る. Workshop
on Physics
of Computing
物 理 学 と 計 算 論 に 関 す る 国 際 ワ ー ク シ ョッ プ で あ り,略
称 をPhysCompと
い う.量 子 コ ン ピ ュ ー タの 実 現 可 能 性 な ど に つ い て ,盛
ん に 議 論 が 交 わ され
て い る.PhysCompのProceedingsはIEEE
ら購 入 す る こ と が で
Pressか
き る. International
Conference
on Quantum
Communication&
Measurement 量 子 通 信 を メ イ ン に し た 国 際 会 議 で あ り,略 1996年
い う. QCMも
か ら 量 子 コ ン ピ ュ ー タ を 積 極 的 に ス コ ー プ に 含 め て い る .QCM'96
のProceedingsは,
Plenum
Publishing
量 子 コ ン ピ ュ ー タ に 関 す る研 究 は,ま WWWサ
称 をQCMと
Corporationか
ら出版 予 定 で あ る .
さ に 現 在 進 行 中 な の で,上
で紹 介 した
イ トや 国 際会 議 な どを通 じて,最 新 の 情 報 を得 る こ とが 大切 で あ る .残
念 なが ら,こ の 分 野 の 研 究 は 日本 で は ま だ あ ま り盛 ん で は な い が,今 後,チ ス に満 ち た こ の分 野 の研 究 が,日 本 で 活 発 に行 わ れ る こ と を期待 して い る .
ャン
第Ⅱ部 量子 コン ピュータの 理 論
第Ⅱ 部
量 子 コ ン ピ ュ ー タの 理 論
量 子 コ ン ピ ュ ー タの研 究 者 を 目指 す 読 者 の 背 景 知 識 は,計 算 機 科 学,数
学,物
理 学 な ど ま ち ま ち で あ る.こ の よ うな 幅広 い 読 者 に 内 容 を理 解 して い た だ くた め に,第
Ⅱ 部 の 記 述 ス タ イル も,理 論 計 算 機 科 学 の テ キ ス トと して は,や や 厳 密 さ
に 欠 け る もの に な っ て い る.し か し,そ の 代 わ りに 幅広 い 読 者 が,内 容 を直 観 的 に 理 解 しや す くな っ た の で は ない か と思 っ て い る. 理 論 計 算 機 科 学 の 立 場 か ら量 子 計 算 の研 究 を行 い た い 読 者 は,本 書 の 内 容 を完 全 に理 解 さ れ た後,本 書 の 末 尾 に挙 げ た 参 考 文 献 や,第
3章 の 最後 にあ るWWW
サ イ トか ら最 新 の論 文 を取 り寄 せ て精 読 して い た だ き たい.本 書 の 内 容 が 理 解 で きて い れ ば,そ れ らの論 文 を読 み 始 め る際 の 苦 労 は か な り軽 減 され るは ず で あ る. な お,そ き た い.
の ため の ガ イ ド を,本 書 の 「あ とが き」 に掲 載 したの で,ご 一 読 い た だ
第
4章
計算論概説
理 論計 算機 科学(Theoretical Computer Science)と
い う学 問分野 をご存 じだ ろ うか? この
分 野 は,応 用 数 学 の 一分 野 に位 置 付 け る ことが で き,P=NP?問
題 な どの,フ ェル マー 予想
に匹敵 す る く らい の 大未 解 決 問題 を有 す る分 野 で あ る.海 外 で は,多 くの若 く優 秀 な頭 脳 が,こ の分 野 で 日夜 しの ぎを削 って研 究 競 争 を繰 り広げ てい る.し か し,残 念 なが ら 日本 で は,こ の分 野 は ま だあ ま り広 くは知 られて い ない よ うであ る. おそ ら く読 者 の 皆 さん は,物 理 学 の 中に理 論 物理 学 とい う分 野 があ る こと はご 存 じだ ろ う.理 論物 理 学 は,物 理 学全 体 に対 す る理論 的 基礎 を与 え る学 問分 野 で あ る.実 は,理 論 計算 機 科学 も まった く同様 に,コ ン ピュー タを設計 した り,ソ フ トウェア を開 発す る際 の理 論 的基礎 を与 える学 問分 野 なので あ る. 本 章 で は,こ の 理論 計 算機 科 学 の 中心 的分 野 で あ る,ア ル ゴ リズム論,オ ー トマ トン理 論,計 算量 理 論 の要 点 を,本 書 の残 りの部 分 を読 む際 に必 要 とな る事 項 に焦点 を絞 って解 説 してい く.
計算時間の測 り方
4.1
コ ン ピ ュ ー タ に問 題 を解 か せ る際 の計 算 時 間 は,ど の よ うに して 測 れ ば よい の だ ろ うか? 一 口 に コ ン ピュ ー タ とい っ て も,パ ー ソ ナ ル コ ン ピ ュ ー タか らス ー パ ー コ ン ピ ュ ー タ に至 る まで 機 種 は千 差 万 別 で あ る.各 ユ ーザ が ,自 分 の 使 用 し て い る コ ン ピュ ー タ上 で の計 算 時 間 を時 計 を 使 って 測 っ た の で は,使 用 機 種 に依 存 した 計 算 時 間 しか 得 られず,本
質 的 に問 題 が 速 く解 け て い る の か 否 か は わ か ら
な い. そ こで,理 論 計 算 機 科 学 の 一 分野 で あ る計 算 量 理 論 で は,計 算 時 間 を実 際 の コ ン ピュ ー タ に依 存 し な い形 で 定 義 して い る.そ の 基 本 的 な考 え 方 は次 の とお りで あ る.ま ず コ ン ピ ュ ー タの 数 学 的 モ デ ル(計 算 モ デ ル と呼 ぶ)M の モデ ル が 実行 可 能 な基 本 操 作 の 集 合 を定 め る.通 常,こ して は,Turing機 Turing機
械 とい うモ デ ルが 採 用 さ れ る(第
を定 義 し,そ
の よ うな計 算 モ デ ル と
2章,お
よ び4.7節
参 照).
械 は 現 在 の コ ン ピ ュ ー タの数 学 的 モ デ ルで あ る.
そ して,採 用 した計 算 モ デ ル の各 基 本 操 作 を 1ス テ ップ と考 え て,あ
る問題 を
解 くた め に 必 要 な計 算 時 間 を,そ の 問 題 を解 くた め に M が 必 要 とす る ス テ ップ 数 と して評 価 す る.そ の 際,解
くべ き問題 P とそ の 解 法 手 続 き(ア ル ゴ リ ズ ム)
A は 固 定 して考 え る が,ア ル ゴ リズ ム A が 問 題 P を解 くの に 要 す る ス テ ップ 数 は問 題 の 入 力 サ イ ズ の 関数 と して表 現 す る. 話 を具 体 的 に す る た め に,コ ン ピュ ー タに解 かせ る問 題 P と して,次 の よ うな 整 数 の ソー テ ィング(並
べ 換 え)の 問 題 を考 え る.ソ ー テ ィ ング 問 題 は,例 え ば
受 験 生 を得 点順 に並 べ た 名 簿 を作 成 す る と き な ど,い ろ い ろ な状 況 で 解 く必 要 に 迫 られ る 問 題 で あ る. ソ ー テ ィ ング 問 題:入
力 と して n 個 の 整 数 が 与 え られ た と き,そ
れ らの 数 を小 さな もの か ら順 に並 べ て 出 力せ よ. この 問 題 を解 くた め の ア ル ゴ リズ ム A と して,バ
ブ ル ・ソ ー ト とい うよ く知 ら
れ た ア ル ゴ リズ ム を採 用 し,バ ブ ル ・ソー トの計 算 時 間 を 理 論 的 に 評 価 して み よ
う.ソ ー テ ィン グ問 題 の 入 力 サ イズ は,入 力 と して与 え られ る整 数 の 個 数 n で あ る.結 論 を先 に述 べ て お く と,以 下 で 示 す バ ブ ル ・ソー トの 計 算 時 間 は,入 力 サ イズ が n の と きに,n2ス
テ ップ よ り も小 さ くな る.
ち な み に,計 算 時 間 を入 力 サ イズ の 関 数 と して 表 現 す る理 由 は 以 下 の とお りで あ る.例 え ば ソ ー テ ィン グ問 題 は,入 力 さ れ た整 数 の 個 数 が 数 十程 度 な らば 人 手 で も簡 単 に解 け る が,そ の 個 数 が 数 千,数 万 に な る と大 変 な作 業 に な る.一 般 に, 我 々は 問 題 P の 入 力 サ イズ n が 増 加 した と きの,ア ル ゴ リズ ム A の 計 算 時 間 の 増 え方 に興 味 が あ る の で,A
の 計 算 時 間 を n の 関数 と して 表 現 す る.そ
して,そ
の 関 数 が 値 の 小 さ な 関数 で あ るほ ど,ア ル ゴ リズ ム A の 時 間効 率 が よい と判 断 す るの で あ る. さ て,ソ ー テ ィ ング の 簡 単 な例 題 を考 え よ う.例 え ば,入 力 と して 5個 の整 数 4,3,1,5,2 が この 順 番 で 与 え られ た とす る.こ れ らの数 を並 べ 換 えて,小
さい も
の か ら 1,2,3,4,5の 順 で 出 力 した い.こ の 作 業 を,バ ブ ル ・ソ ー トとい うア ル ゴ リズ ム を用 い て行 った 様 子 が,図4.1(a)に
示 され てい る.こ の 例 に 沿 って,ア
ル ゴ リズ ム の動 作 を説 明 しよ う.
(a)
(b)
図4.1
バ ブ ル ・ソ ー トの 処 理 の 流 れ.(a)最 し た 数 を 表 して い る.
初 の 例 題.(b)第
2の 例 題.太
字 の数 は位 置 が確 定
ま ず,図4.1(a)の
一 番左 の 行 に 入 力 43152
が 示 さ れ て い る(図4.1の と す る).図4.1で
は,入
列 を 横 書 き に す る と き に は,上
の 数 を左 側 に 書 く も の
力 は 与 え ら れ た 順 番 に 上 か ら書 か れ て い る.つ
ま り,こ
の 場 合 に は 4 が 入 力 の 最 初 の 数 で あ り,2 が 最 後 の 数 で あ る. 以 下 で は,バ
ブ ル ・ソ ー ト で 用 い られ る 基 本 操 作 を 次 の よ う に 定 め る(注 1)
基 本操 作: て,も
(図4.1の)あ
る列 の 数 x を そ の 真 上 の数 y と比 較 し
し x が y よ り小 さけ れ ば x とyの
位 置 を入 れ 換 え る.さ
も
なけ れ ば,こ の 入 れ換 えは行 わ な い. バ ブ ル ・ソ ー トで は,こ
の 操 作 を 列 の 一 番 下 の 数 の 組(x,y)か
ら始 め て,次
第 に
列 の 上 の 数 の 組 に 適 用 し て い く.
図4.1(a)の
例 で い え ば,ま ず 最 初 に,数
x と して入 力 の 最 後 の数 2が 取 られ,
数 y と して は そ の 真 上 の 数 5が 取 ら れ る.そ
して,上 の 基本 操 作 が適 用 され るが,
この 場 合 に は 2は 5よ り も小 さい か ら,そ れ らの 場 所 の 入 れ換 えが 行 わ れ,数 の 並 びは 43125 と な る.引
き続 き,同 様 の 操 作 を この 列 の 左 隣 の 数 の 組 に対 して 適 用 す る.す
わ ち,x=2,y=1と
な
取 って 基 本 操 作 を再 度 適 用 す る.し か し,今 回 は x が y
よ り小 さ くない の で,数 の 入 れ 換 え は 起 こ らず,数
の並び は
43125
の ま ま で あ る.さ ら に処 理 は左 に 進 み,x=1,
y=3に
対 して 基 本 操 作 が 再 度 適
用 され る.今 度 は x が y よ りも小 さい か ら入 れ換 えが 行 わ れ,数 の 並 び は 41325 (注 1)この 基本 操作
は,Turing機
械 が 1ステ ップ で実 行 可能 な もの で はな い.し か し,こ の操 作 はTuring機
械 が 定数 ス テ ップ で 実行 可能 なの で,話 を 簡潔 にす るた めに,便 宜 的 に 1ステ ップ で実 行 可 能 と考 えて い る.
とな る.引 る.今
き続 き,処 理 は左 に進 み,x=1,y=4に
対 して基 本 操 作 が 適 用 され
回 も x が y よ りも小 さい か ら入 れ換 え が 行 わ れ,数 の並 び は 14325
とな る.以 上 で,処 理 が列 の左 端(図4.1(a)で
い え ば 上 端)ま で 進 ん だ の で,処
理 の 第 1ラ ウ ン ドが 終 了 した.こ の 第 1ラ ウ ン ド終 了 時 の 結 果 が,図4.1(a)の
左
か ら 2番 目の 列(こ の 列 を 「列 2」 と呼 ぼ う)に 示 され て い る. 以 上 の よ う な処 理 を行 う と,第
1ラ ウ ン ド終 了 時 点 に は,「列 2」 の 一 番 上 に 入
力 中 の 最 小 数 が現 れ る こ とが わ か る.そ こ で,こ の 最 小 数 1は も う固 定 して し ま い,「列 2」 の 中の 残 りの 四 つ の 数 の並 び 4325
に対 して,第 す な わ ち,第
1ラ ウ ン ド と同 様 の処 理 を実 行 す る.こ 2ラ ウ ン ドはx=5.y=2に
処 理 が 始 ま る.第
れが 第 2 ラ ウ ン ド で あ る.
対 して 基 本操 作 を適 用 す る と こ ろ か ら
2 ラ ウ ン ドが 第 1ラ ウ ン ド と最 も大 き く異 な る点 は,二 つ の数
の 比 較 の 回数 が 1回減 る こ とで あ る.す な わ ち,「列 2」 の 一 番 上 の 数 1は 最 小 数 で あ る こ とが す で にわ か っ て い る の で,第 しな い.つ て,第
ま り,y=1と
2ラ ウ ン ドで は も はや 比 較 の 対 象 とは
取 られ て基 本 操 作 が 適 用 され る こ とは な い.し
1ラ ウ ン ドで は 合 計 4回 の 比 較 が 行 わ れ た が,第
の 比 較 しか行 わ れ ない.第
たが っ
2 ラ ウ ン ド で は 合 計 3回
2ラ ウ ン ド終 了 時 の結 果 を,図4.1(a)の
左 か ら 3番 目
の列(「 列 3」)に 示 した. 以 下 同 様 に,「列 3」 の 上 か ら二 つ の 数 1,2は 固 定 して 考 え,「列 3」 の 中の 残 り の三 つの数の並 び 435
に対 して,第
3 ラ ウ ン ドの 処 理 を 実 行 す る.第
作(比 較)が 行 わ れ る.第
3ラ ウ ン ドで は 合 計 2回 の 基 本操
3 ラ ウ ン ド終 了 時 の結 果 は,図4.1(a)の
左 か ら 4番 目
の 列(「 列 4」)に 示 さ れ て い る.最 後 に,「列 4」 の 中 の残 りの 二 つ の 数 の 並 び 45
に 対 し て,第
4 ラ ウ ン ド の 処 理 を 実 行 す る.第
わ れ な い が,こ い る の で,数
の 例 の 場 合 に は,数
が す で に 小 さ い も の か ら順 に 並 ん で し ま っ て
の 入 れ 換 え は 起 こ ら な い.し
で 数 の 並 び に 変 化 は 起 き な い.第
4 ラ ウ ン ドで は 1回の 比 較 しか行
た が っ て,第
4 ラ ウ ン ドの 実 行 の 前 後
4 ラ ウ ン ド終 了 時 の 結 果 が,図4.1(a)の
左 か ら
5番 目 の 列(「 列 5」)に 示 さ れ て い る が,こ
れ が バ ブ ル ・ソ ー トの 実 行 結 果 で あ る.
ち な み に,バ
ラ ウ ン ド に お い て処 理 対 象 とな る数 の
ブ ル ・ソ ー ト の 名 前 は,各
並 び の 中 の 最 小 数 が,(図4.1で い る.も
ち ろ ん,バ
次 に,バ
の よ うに 上 が っ て くる こ と に 由来 して
ブ ル ・ソ ー トの ア ル ゴ リ ズ ム は,入
て も正 し く動 作 す る.例 図4.1(b)に
見 る と)泡
え ば,入
力 が5,4,3,2,1の
力 が ど の よ う な もの で あ っ
場 合の ア ル ゴ リズ ム の動 作 を
示 し た. ブ ル ・ソ ー ト の 計 算 時 間 を 評 価 し て み よ う.基
お り で あ る.上
の 例 か ら も わ か る よ う に,バ
力 さ れ た 整 数 の 個 数(入 理 が 実 行 さ れ る.そ
力 サ イ ズ)が
本操作 は上で定め た と
ブ ル ・ソ ー ト の 実 行 に お い て は,入
n の と き に は,全
部 でn-1ラ
ウ ン ドの処
し て,
第 1 ラ ウ ン ドで は全 部 でn-1回
の 基 本 操 作 が 実 行 され,
第 2 ラ ウ ン ドで は 全 部 でn-2回
の 基 本 操 作 が 実 行 され,
第 3 ラ ウ ン ドで は全 部 でn-3回
の 基 本 操 作 が 実 行 さ れ,
第n-2ラ
ウ ン ドで は全 部 で 2 回 の 基 本 操 作 が 実 行 さ れ,
第n-1ラ
ウ ン ドで は全 部 で 1回 の 基 本 操 作 が 実 行 さ れ る.
した が って,入 力 サ イズ が n の と きのバ ブ ル ・ソ ー トの 基 本 操 作 の 実行 回 数,す な わ ち ス テ ップ 数 は,
と な る.
数学 メモ 1 等差 数 列の和
こ の 公 式 に お い てk=n-1と
よ っ て,バ
置 く と 上 の 式 が 得 ら れ る.
ブ ル ・ソ ー ト の 計 算 時 間 は 入 力 サ イ ズ を n と す る と き,n2ス
テ ッ
プ よ り も小 さ く な る こ と が わ か っ た. 実 は,ソ
ー テ ィ ン グ に 対 し て は,バ
ブ ル ・ソ ー ト よ り も 時 間 効 率 の よ い ク イ ッ
ク ・ソ ー ト と い う ア ル ゴ リ ズ ム が 知 ら れ て い る[3].ク
イ ッ ク ・ ソ ー トの 実 行 時
間 は,入
力 サ イ ズ を n と す る と き,平
nス
定 数.以
後,こ
の よ う な 式 をcn log nと
さ ら に,Turing機
で あ る.し
略 記 す る.)で
た が っ て,ク
か し,ク
低 限nlognス
テ ッ プ(た
だ し cは
あ る こ と が 知 ら れ て い る.
械 の よ う な 通 常 の 計 算 モ デ ル 上 で,2
ソ ー テ ィ ン グ を行 う た め に は,最 で き る[3].し
均 でC×n×log
数 の大 小 比 較 に基 づ い て
テ ップ が 必 要 で あ る こ とが 証 明
イ ッ ク ・ソ ー ト は 最 良 の ソ ー テ ィ ン グ ・ア ル ゴ リ ズ ム
イ ッ ク ・ソ ー トを 紹 介 し よ う と す る と説 明 が 長 く な る の で,本
節 で は 簡 単 な バ ブ ル ・ソ ー ト を 紹 介 し た.
数学 メモ 2 対 数 2x=nの 書 く.例
と き, x を,2
を 底 とす る n の 対 数 と い い, x=log
え ば,log 2=log
本 書 で は,logは
21=1,
log 4=log
22=2な
底 2 の 対 数 を 表 す の に 用 い る(底
用 対 数 と い うが,通
常 は,常
用 対 数 を 表 す 際 に,底
が10の
nと
ど と な る. 対 数 を常
を略 し てlognの
よ う に 書 く.)
4.2
計算機 の物理的実現方法 と計算時間
前 節 の 終 わ りで,Turing機
械 の よ う な通 常 の計 算 モ デ ル 上 で,2 数 の 大 小 比 較
に基 づ い て n 個 の 整 数 の ソ ー テ ィ ング を行 うた め には,最 低 限nlognス
テ ップ
が 必 要 で あ る と 述 べ た.と
こ ろ が,ソ
ー テ ィ ン グ 問 題 を ほ ぼ2nス
テ ップ で 解 く
次 の よ う な 方 法 が あ る(注1). ま ず,ソ
ー トす べ き n 個 の 整 数x1,x2,…xnが
入 力 と し て 与 え ら れ た ら,ゆ
で る 前 の 固 い ス パ ゲ ッ テ ィ を n 本 用 意 す る(話 き 数 は す べ て ス パ ゲ ッ テ ィ の 長 さ(単 し て,1
位:㎜)以
本 目 の ス パ ゲ ッ テ ィ を 長 さxl ㎜
を 長 さx2 ㎜
に 切 り,以
を 簡 単 に す る た め に ,ソ
ー トす べ
下 で あ る と仮 定 し て お く).そ
に 切 り,続
い て 2 本 目 の ス パ ゲ ッテ ィ
下 同 様 に し て, n 本 目 の ス パ ゲ ッ テ ィ を 長 さxn ㎜
に 切 る ま で 同 じ作 業 を 繰 り返 す.こ ゲ ッ テ ィ を 束 に して つ か み,机
の 作 業 が 終 了 し た ら,切
り終 え た n 本 の ス パ
の 上 に 片 側 を 揃 え て 立 て る.そ
の 結 果,一
番先端
が 飛 び 出 し て い る ス パ ゲ ッ テ ィの 表 現 し て い る 数 が 入 力 中 の 最 大 数 な の で ,ま ず そ の ス パ ゲ ッ テ ィ を 抜 き 出 し て 机 の 上 に 置 く.次 飛 び 出 し て い る ス パ ゲ ッ テ ィ を 取 り 出 し て,先 の 右 隣 に 置 く.以
下 同 様 の 作 業 を,束
上 の 作 業 が 終 了 した と き に は,机 順 に(左 さ て,こ
か ら)並
に,残
ほ ど机 の 上 に 置 い た ス パ ゲ ッテ ィ
の ス パ ゲ ッ テ ィが な く な る ま で 繰 り返 す .以
の 上 に は n 本 の ス パ ゲ ッ テ ィが,長
の 手 続 き の ス テ ッ プ 数 を 考 え て み よ う〔 注2).ま ず,n
の 上 に 立 て る の に 1 ス テ ッ プ を 要 し,そ に 抜 き 出 し て い くの に,n パ ゲ ッ テ ィが,そ す る か ら,全
に,ス
パ ゲ ッ テ ィの 束 を机
終 的 に机 の 上 に 並 ん だ n 本 の ス
の ま ま 出 力 結 果 を 与 え て い る と 解 釈 す れ ば ,処
体 で は2n+1ス
本 の ス パ ゲ ッテ ィ
の 束 か ら ス パ ゲ ッ テ ィ を 長 い も の か ら順
ス テ ッ プ を 要 す る.最
理 は 以 上 で終 了
テ ッ プ で ソ ー テ ィ ン グ が 終 了 して い る こ と に な る.
ー テ ィ ン グ に は 最 低 で もnlognス
れ は 一 体 ど う し た こ と で あ ろ う か?nlognス プ で,ソ
い もの か ら
べ ら れ て い る は ず で あ る.
の 長 さ を 切 り揃 え る の に n ス テ ッ プ が 必 要 で あ る .次
前 節 で,ソ
りの 束 の 中 で 先 端 が 最 も
テ ッ プ が 必 要 で あ る と 述 べ た が,こ テ ップ よ り も 少 な い2n+1ス
テ ッ
ー テ ィ ン グ が 行 え て し ま っ た!
こ こ で 紹 介 し た ス パ ゲ ッ テ ィの よ う な 計 算 の 道 具 を,ア
ナ ロ グ ガ ジ ェッ ト と い
(注1)2 数の大小比較以外のある種の操作を仮定すれば,通 常のコンピュータにおいても,ソ ーテ ィングをcn ステップで行 うこ とがで きるバケ ットソー トなどのアルゴリズムが知られている. (注2)ここでのステ ップ数は,こ のアルゴリズムの実行者である人間が 1ステップ とみなす基本操作 に基づい て数 えられる.
う[18].ス
パ ゲ ッテ ィ ・ソ ー テ ィ ン グ は,人
行 で き る が,お
間 が 行 うの で あ れ ば非 常 に安 価 に実
そ ら く実 用 に は な ら な い.例
ち い ち 切 り刻 ん で,そ な い で あ ろ う.あ
え ば,1
れ ら を 束 に し て 立 て て,な
る い は,こ
万 本 もの スパ ゲ ッテ ィをい
ど と い う こ と を 行 う物 好 き は い
の ス パ ゲ ッ テ ィ ・ソ ー テ ィ ン グ を 実 行 す る ロ ボ ッ ト
を 作 成 す る こ と も 考 え ら れ る が,ソ
ー テ ィ ン グ と い う 一 つ の 作 業 だ け を 行 う特 殊
な ロ ボ ッ ト を 開 発 す る こ と は 大 変 不 経 済 で あ る. しか し,ス
パ ゲ ッテ ィ ・ソ ー テ ィ ン グ の 話 は,理
論 的 に は 非 常 に 重 要 な 教 訓 を含
ん で い る.つ
ま り,ス
論 上 ソー テ ィ ング に 必 要 な最 低
パ ゲ ッ テ ィ を 用 い る と,理
限 の 計 算 時 間 よ り も,短
い 時 間 で ソ ー テ ィ ン グ が 行 え て し ま っ た の で あ る.な
こ の よ う な こ と が 起 き た の だ ろ う か? と が 起 こ る の は,計 テ ィ)の
結 論 か ら い っ て し ま え ば ,こ
算 に 利 用 して い る 道 具(こ
ロ バ ン で あ る た め,立
ま り,Turing機
械 をモ デ ル と し
質 的 に 2進 数 を 取 り扱 う高 級 電 子 ソ
て た ス パ ゲ ッテ ィの 束 か ら 最 も 長 い も の を 選 び 出 し て い く
こ と に 相 当 す る 操 作 を,n 以 上 の 話 は,以
の よ うな こ
の 場 合 は コ ン ピ ュ ー タ とス パ ゲ ッ
物 理 的 性 質 の 違 い に 原 因 が あ る の だ.つ
て 実 現 さ れ て い る 現 在 の コ ン ピ ュ ー タ は,本
ぜ
ス テ ップ で は実 行 で きな い の で あ る.
下 の よ う な 教 訓 を 含 ん で い る.
「コ ン ピ ュー タの 物 理 的 実 現 方 法 を本 質 的 に変 更 す れ ば,非 常 に高 速 な コ ン ピュ ー タが 実現 で き る可 能 性 が あ る.」 計 算 尺 か ら手 回 し計 算 機,さ
ら には電 子 計 算 機 へ とい う計 算 機 の発 展 の歴 史 は,ま
さに この 教 訓 の 実 践 の 過 程 で あ っ た と も考 え られ る.そ
して,コ
ン ピュ ー タ を量
子 力 学 の 原 理 に従 うシ ス テ ム と して実 現 で きれ ば,計 算 速 度 を現 在 よ り も飛 躍 的 に 向 上 させ る こ とが で き るの で は な い か と考 え た こ とが,量
子 コ ン ピ ュ ー タが 考
案 され た根 本 的 な 理 由 で あ ろ うと筆 者 は考 え て い る.
4.3 次 に,グ
多項 式 時 間 ア ル ゴ リズ ム ラ フ 理 論 の 問 題 に つ い て 考 え て み よ う.図4.2の
よ う な,頂
点 と辺 か
(a)
図4.2
種 々 の グ ラ フ.(a)閉
路 的 グ ラ フ,(b)ハ
ら な る 網 状 の 図 形 を グ ラ フ と い う.図4.2で を 結 ぶ 線 分 が 辺 を 表 し て い る.グ の こ と を い う.た
ミル ト ン グ ラ フ,(c)非
は,黒
ラ フ G の 路 と は,Gの
つの黒丸
頂 点 の 列x0,x1,…,xl
G の辺 で 結 ば れ て い る もの
閉 路 で あ る と は,l〓3,
x0=xlで
あ り,か
つ頂点
ミ ル ト ン グ ラ フ と は,そ
のすべ
互 い に 相 異 な る と き を い う.
閉 路 を 含 む グ ラ フ を 閉 路 的 グ ラ フ と い う.ハ て の 頂 点 を 含 む 閉 路(ハ 連 結 グ ラ フ と は,そ
グ ラ フ だ が,ハ
存 在 す る よ う な グ ラ フ で あ る.ま
え ば,図4.2(a)の
ミ ル ト ン グ ラ フ で あ る.ま
た,
れ らを結 ぶ 路 が 存 在 す る
グ ラ フ は 閉 路1231を
ミ ル ト ン グ ラ フ で は な い.図4.2(b)の
含 む の で,ハ
ラ フ だ が,(c)は
ミ ル ト ン 閉 路)が
の 相 異 な る 任 意 の 2頂 点 に 対 し,そ
よ う な グ ラ フ で あ る.例
123451を
連 結 グ ラ フ.
丸 が 頂 点 を 表 し,二
だ し,xiとxi+1(0〓i