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
量子计算机编程:从入门到实践
真实的数据
|
147
必须努力跟踪给定
QPU
寄存器中的数据所使用的特定编码,以便正确地解释其量子比特
的状态。
请注意,使用二进制补码和定点编码的操作经常会导致
溢出
,这是由于计算
结果太大,无法在寄存器中表示。这实际上会弄乱输出结果,把它变成毫无
意义的数字。遗憾的是,真正解决溢出问题的唯一方案是向寄存器中添加更
多的量子比特。
9.2
QRAM
我们现在可以在
QPU
寄存器中表示不同的数值了,但是如何将这些数值输入
QPU
寄存器
中呢?手动初始化输入数据的做法很快就会过时。我们真正需要的是从内存中读取数值的
能力。内存中的二进制地址帮助我们定位存储的值。程序员通过两个寄存器与传统的随机
存取存储器(
random access memory
,
RAM
)打交道:一个被初始化为内存地址,另一个
未被初始化。给定这些输入后,
RAM
将第二个寄存器设置为存储在第一个寄存器指定地
址的二进制内容,如图
9-2
所示。
输出寄存器
地址寄存器
地址
值
图
9-2
:传统的
RAM
。图中的表展示了存储的值以及用于访问这些值的接口
我们可以使用传统的
RAM
来存储初始化
QPU
寄存器的值吗?这个想法很吸引人。
如果只想用一个常规值初始化
QPU
寄存器(无论是二进制补码、定点值还是简单的二
进制编码),那么
RAM
足以满足要求。我们只需先将相关的值存储在
RAM
中,然后使
用
write()
或
read()
,通过
QPU
寄存器插入或获取它。这正是迄今为止
QCEngine
的
JavaScript
代码在幕后与
QPU
寄存器打交道的方式。
举个例子,示例
9-1
中的代码接受数组 ...
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