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
量子计算机编程:从入门到实践
22
|
第
2
章
WRITE
HAD
READ
图
2-10
:生成随机字节
示例
2-2
展示了用于生成随机字节的代码,它与示例
2-1
相差不大。
示例代码
请在
http://oreilly-qc.github.io?p=2-2
上运行本示例。
示例
2-2
随机字节
qc
.
reset
(8);
qc
.
write
(0);
qc
.
had
();
var
result
=
qc
.
read
();
qc
.
print
(
result
);
请注意,我们利用了这样一个事实:除非明确地指定要操作的量子比特,否则
QCEngine
指令(如
WRITE
和
HAD
)将默认应用于所有经过初始化的量子比特。
尽管示例
2-2
用了多个量子比特,但实际上没有进行将多个量子比特作为输
入的运算。该程序只能被序列化为针对单个量子比特运行。
单个量子比特
|
23
2.3.5
QPU
指令
:
PHASE(
θ
)
PHASE(
θ
)
也没有针对传统比特的等价运算。它使得我们能够直接操作量
子比特的相对相位,将其改变某个特定的角度。因此,除了要操作的量
子比特之外,
PHASE(
θ
)
还需要一个额外的数值参数,即旋转角度。例如,
PHASE(45)
表示进行
45
°的旋转运算。
在使用圆形表示法表示时,
PHASE(
θ
)
的作用就是简单地以指定的角度旋转
|
1
⟩
圆。图
2-11
展示了
PHASE(45) ...
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