在看一些量子计算机相关的文献,看到这么一段:
来源:
http://www.monoidal.net/papers/tutorialqpl-2.pdfSpecication and verication.
In classical programming languages, debuggers
are useful tools while writing programs. In quantum computation, due to
impossibility to watch quantum information without modifying it, a debugger
for a program is a lost cause.
In classical programming languages, one can develop test suites to analyze
the behavior of a program and check whether it (statistically) behaves
correctly in the expected input data-range. In the case of embedded software, if
it is not possible to do it with the actual device, one can usually perform these
tests o-site. In quantum computation, because of the cost of running code
early quantum computers and the impossibility to e efficiently simulate quantum
computation on large inputs, test suites are not an option.
In typed classical programming languages, one has the choice between
strong type systems, dynamic type systems, or even blends of these, bearing the
fact that run-time errors can be captured and potentially resolved by the user
(as in LISP, for example). In quantum computation, due to the cost of the run
of a quantum computation and the difficulty to keep stable quantum memory,
the programmer cannot afford run-time errors in his code, specially if they come
from something as simple as the attempt to clone a quantum bit.
The conclusion is that the work have to be done upstream.
简单的说就是由于观察者效应,对量子态的观察必定会造成结果的改变,你不可能设个断点然后把量子CPU上的寄存器内容撸出来看了,还能继续正确运行,你一观察内容就变了。所以调试器是不可能有的。
由于运行成本高,以及不可能有效的对输入数据规模很大时的运算过程进行模拟,所以测试也是不可能。
唯一的出路只有在编译时验证。
所以如果人类一开始捡到了外星人的黑科技,尝试在没有电子计算机的情况下,直接去点量子计算机的科技树,可能根本无法做到自举,因为要写出一定规模的量子程序,需要首先有另外一种运算能力强的设备去撸编译器。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/114409
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.