Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
量子计算机编程:从入门到实践
by
Eric R. Johnston
,
Nicholas Harrigan
,
Mercedes Gimeno-Segovia
July 2021
Beginner to intermediate
274 pages
7h 10m
Chinese
Posts & Telecom Press
Content preview from
量子计算机编程:从入门到实践
舒尔分解算法
|
203
由于峰值是均匀分布的,并且寄存器大小已知,因此我们可以估计
QFT
中有多少峰值——
即使不可能实际观测到多个峰值,也可以估计(我们很快将给出一个明确的算法)。从实
验中可知,峰值的数量和输入信号的重复周期
p
是一样的——我们要的就是这个数!
与第
7
章介绍的方法相比,这是对
QFT
的更为间接的用法,但它告诉了我们一件重要的事
情——我们应不惮于使用任何可以使用的工具来试验
QPU
寄存器中的内容。令人宽慰的
是,即便使用的是
QPU
,神圣的程序员箴言“修改代码,看看会发生什么”依然十分
有用。
12.3
逐步操作
:
分解数字
15
让我们逐步看一下如何使用
QPU
来分解数字
15
(剧透警告:答案是
3
×
5
)。随着我们尝
试分解更大的数字,程序会变得越来越复杂,但是
15
是一个很好的开始。下面使用示例
12-3
中的设置来演示算法的操作。
示例代码
请在
http://oreilly-qc.github.io?p=12-3
上运行本示例。
示例
12-3
分解数字
15
var
N
=
15
;
//
要分解的数字
var
precision_bits
=
4
;
//
相关说明,请参见正文
var
coprime
=
2
;
//
在这个
QPU
实现中必须是
2
var
result
=
Shor
(
N
,
precision_bits
,
coprime
);
在本例中,第一个参数
N
被设置为
15
,这是我们要分解的数字。第二个参数
precision_
bits
是
4
。使用更多的精度位通常更有可能返回正确的答案,但缺点是需要更多的量子比
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
JAVASCRIPT之美|聽頂尖程式設計師闡述他們的思維
Anton Kovalyov
Go程序设计语言
艾伦A. A.多诺万, 布莱恩W. 柯尼汉
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
监控运维实践:原则与策略
Mike Julian
Publisher Resources
ISBN: 9787115566355