当前位置:网站首页>Q_04_06 把它放在一起:传送
Q_04_06 把它放在一起:传送
2022-08-09 13:02:00 【MOVCat】
把它放在一起:传送
让我们回到在量子电路中定义的远距传感电路的例子。下面显示的是一个实现远距传送的教科书量子电路,包括量子部分,测量和经典控制的校正操作。
我们现在可以将这个量子电路中的每个步骤转换为Q#。首先,我们开始定义一个新的操作,同时执行两个量子位msg
的远距传送:
operation Teleport(msg : Qubit, there : Qubit) : () {
body {
接下来,我们here
用一个using
块来分配一个量子位:
using (register = Qubit[1]) {
let here = register[0];
然后我们可以通过使用H和CNOT操作在here
和there
创建纠缠对:
H(here);
CNOT(here, there);
然后我们使用下一个 operatornameCNOT
和Hgates来移动我们的消息量子位:
CNOT(msg, here);
H(msg);
最后,我们使用M来执行测量并将它们馈送到经典控制中,如if
语句所示:
// Measure out the entanglement. if (M(msg) == One) { Z(there); } if (M(here) == One) { X(there); }
这完成了我们的teleportation操作符的定义,所以我们可以here
释放,结束身体并结束操作。
}
}
}
边栏推荐
- 第六届”蓝帽杯“全国大学生网络安全技能大赛 半决赛
- FFMPEG multimedia file processing (deletion and renaming of ffmpeg files)
- read stream 特别注意
- read stream special attention
- error Trailing spaces not allowed no-trailing-spaces 9:14 error Unexpected trailing comma
- IDEA Gradle 常遇问题(一)
- 现在40系显卡都快出来了,为何1060型号的显卡还有这么多人用?
- Final assignment of R language data analysis in a university
- 基于 R 语言的判别分析介绍与实践 LDA和QDA
- Anta and Huawei Sports Health jointly verify the champion running shoes and lead Chinese sports with innovation
猜你喜欢
5G China unicom AP:B SMS ASCII Transcoding Requirements
Uni - app - uview Swiper shuffling figure component, click on the links to jump (click to get the item after the row data, remove data operation)
render解析
Oracle Recovery Tools修复空闲坏块
eslint语法规则报错
5G China unicom repeater network management protocol real-time requirements
Final assignment of R language data analysis in a university
面试攻略系列(四)-- 你不知道的大厂面试
jenkins api create custom pipeline
微服务+微信小程序实现社区服务
随机推荐
万物皆可柯里化的 Ramda.js
telnet+ftp to control and upgrade the device
快来扔鸡蛋。
gin's middleware and routing grouping
驻波比计算方法
WSA toolkit installed app store tip doesn't work how to solve?
Standing wave ratio calculation method
glibc memory management model freeing C library memory cache
【瑞吉外卖】day05:增、删、改、查分类以及公共字段自动填充
用plot_hist_numeric()实现画直方图
WSA工具箱安装应用商店提示无法工作怎么解决?
电脑重装系统后桌面图标如何调小尺寸
RTSP协议讲解
Yocto 可以下载的第三方库
技嘉显卡 RGBFusion 不能调光解决方法
FPGA中串口通信的时钟频率和波特率计数
面试攻略系列(三)-- 高级开发工程师面试问些啥?
NFS pays special attention to the problem of permissions
NFS 特别注意权限的问题
LeetCode 37.解数独