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
量子计算机编程:从入门到实践
71
第
5
章
量子算术与逻辑
相比于传统的应用程序,
QPU
应用程序的优势在于能够在叠加态下进行大量的逻辑运算
1
。
上述优势的重点是将简单的算术运算应用于处于叠加态的量子比特寄存器,本章将详细讨
论如何做到这一点。我们会先在较为抽象的层面上讨论传统编程所涉及的算术运算,即处
理整数和变量,而不是量子比特;然后,我们会深入地研究基本的量子逻辑运算(类似于
基本的数字逻辑门)。
5.1
奇怪的不同
传统的数字逻辑有许多很好的优化方法来执行算术运算。为什么不能直接把传统比特替换
为量子比特,然后用在
QPU
中呢?
当然,问题是传统的运算一次只针对一组输入,而量子运算中的输入寄存器通常处于叠加
态。为此,我们希望量子运算影响叠加态中的
所有值
。
让我们从一个简单的例子开始,来理解如何针对叠加态进行逻辑运算。假设有
3
个单量子
比特
QPU
寄存器,分别记为
a
、
b
、
c
。我们想实现以下逻辑:
if (a and b) then invert c
。
也就是说,如果
a
的值是
|
1
⟩
,并且
b
的值也是
|
1
⟩
,就将
c
的值翻转。我们在图
3-20
中看
到过,可以利用托佛利门直接实现这个逻辑。如果
a
的值是
|
1
⟩
,而
b
的值是
|
0
⟩
,那么托
佛利门对
c
没有影响。如图
5-1
所示,托佛利门会直接交换
|
3
⟩
圆和
|
7
⟩
圆,而不考虑其中
注
1
:
只有叠加态是不够的。正如第二部分的介绍所述,关键的步骤是确保能够以可行的方式读取并行计算
结果,而不是让计算结果一直隐藏在量子态中。
72
|
第
5
章
的内容。因为
|
3
⟩
圆和
|
7
⟩
圆都是空心圆,所以交换操作并没有实际影响。
图
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