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
量子计算机编程:从入门到实践
振幅放大
|
95
AA
迭代次数
读出标记值的概率
图
6-7
:读出标记值的概率与
AA
迭代次数的关系
一般来说,可以通过一个简单却实用的方程式来决定
AA
迭代的次数
N
AA
,执行
N
AA
次
AA
迭代将在第一个振荡周期中获得最高的成功概率。(在前面的例子中,当
N
AA
等于
3
时,
有
96.1%
的成功概率。)在方程式
6-1
中,
n
是量子比特数。
方程式
6-1
振幅放大的最佳迭代次数
N
AA
n
=
π
2
4
我们现在有了一个工具,它可以将
QPU
寄存器中的单个相位差转换为可检测的强度差。
但是,如果寄存器中有多个相位差,该如何处理呢?很容易想到,比翻转更复杂的子例程
或许可以改变寄存器中多个值的相位。幸运的是,
AA
迭代可以应对一般情况。
6.4
多个标记值
通过对示例
6-2
进行小小的修改,可以在具有任意数量的相位翻转值的寄存器上执行多次
AA
迭代。在示例
6-3
中,你可以使用变量
n2f
设置寄存器中的哪些值会在每次
AA
迭代中
被子例程翻转。与之前一样,还可以使用变量
number_of_iterations
调整
AA
迭代的次数。
示例代码
请在
http://oreilly-qc.github.io?p=6-3
上运行本示例。
示例
6-3
有多个标记值的
AA
迭代
var
n2f
=
[
0
,
1
,
2
];
//
翻转哪些值
var
number_of_iterations
=
50
;
// AA
迭代次数
var
num_qubits
=
4;
qc
.
reset
(
num_qubits
);
96
|
第
6
章
var
reg
=
qint
.
new ...
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