Data for "Phase transition in Random Circuit Sampling"
收藏资源简介:
Purpose This dataset defines the Random Quantum Circuits (RQCs) used in our paper "Phase transition in Random Circuit Sampling" and lists the bitstrings observed in the experimental executions of the circuits on the Sycamore processor. See [1] for more details about the experiment. This data upload is modeled after that of [5]. Background Circuit parameters RQCs posted here are uniquely identifiedusing the following parameters: `n`: number of qubits (69, 70), `m`: number of cycles (04, 06, 08, ..., 28, 30), `s`: seed for the pseudo-random number generator (000, 001, ..., 595), `patches`: the number of patches, `p`: sequence of coupler activation patterns (`ABCD`, `ABCDCDAB`), `num_sq`: the number of distinct single-qubit gates (3, 8), the date on which the data was collected, included in yymmdd format in the filename, and `phase_match`: included in the file name if phase matching was performed. See Figure S25 in [2] and Figure 3 of [1] for the coupler activation patterns and Figure 4 of [1] for illustrations of the patches. Also see code snippets below for visualizing the patches and activation patterns from the provided circuits.When `num_sq` is 8, the single-qubit gates are chosen randomly from \(Z^p X^{1/2} Z^{-p}\), with \(p \in \{-1, -3/4, -1/2, -1/4, 0, 1/4, 1/2, 3/4 \}\), whereas when `num_sq` is 3, they are chosen randomly from among \(\sqrt X\), \(\sqrt Y\), and \(\sqrt W\). Phase matching is described in Appendix C.1 of [1]. Note that circuits which share the same seed `s` share the same initial gate sequence. Content description For each RQC there are four files in the dataset: * original RQC specification in QSIM format, named `circuit_\*.qsim`, * derived RQC specificaton as python code using cirq, named `circuit_\*.py`, * derived RQC specification in QASM format, named `circuit_\*.qasm`, * bitstrings observed in experiments, named `measurements_\*.txt`. The asterisk \* in the names above stands for a string specifying the parameters identifying a RQC. For example,`circuit_n70_m24_s00_patches3_pABCD_num_sq8_221014_phase_match.qasm` contains the definition of the 70-qubit, 24-cycle RQC with PRNG seed 0, 3 patches, a simplifiable sequence of coupler activation patterns (i.e. ABCD), and 8 distinct single-qubit gates, taken on October 14, 2022, with phase matching, in the QASM format. Files are grouped by parameters `n`, `m`, and `patches` and into compressed tarballs. For example, tarball `n69_m04_patches2.tar.gz` contains all RQCs and measurement files for circuits with 69 qubits, 4 cycles, and 2 patches. Circuit file formats QSIM format First line specifies the number of qubits n. Each subsequent line specifies a single gate and consists of moment number, gate name and one or two qubits as a number in 0..n-1 optionally followed by gate parameters. The circuits use the following gates: * `x_1_2`: parameter-free, single-qubit pi/2 rotation around the X axis of the Bloch sphere, see equation (45) in section VII of [2], * `y_1_2`: parameter-free, single-qubit pi/2 rotation around the Y axis of the Bloch sphere, see equation (46) in section VII of [2], * `hz_1_2`: parameter-free, single-qubit pi/2 rotation around the X+Y axis of the Bloch sphere, see equation (47) in section VII of [2], * `rz`: single-qubit rotation around the Z axis of the Bloch sphere through the angle specified in radians by the gate's sole parameter, * `fsim`: two-qubit gate corresponding to the composition of the iSWAP and CPHASE gates and taking two parameters in radians: theta (the negative iSWAP angle) and phi (the CPHASE angle), see equation (48) in section VII of [2]. Note that the two-qubit gates executed in our experiments on Sycamore belong to the five-parameter family of two-qubit gates that preserve the number of 0 and 1 states of the qubits. Each such gate can be decomposed into one fsim gate and four rz gates. Therefore, one cycle consisting of one application ofsingle-qubit gates and one application of two-qubit gates is represented in the file using four moments. The first moment contains `x_1_2`, `y_1_2` and `hz_1_2` gates. The other three moments use `rz` and `fsim` gates to describe the two-qubit gates used in the experiments. See section VII in [2] for more details about the Sycamore gates and their decomposition. Qubits are specified as numbers in 0..n-1 and hence do not directly indicate qubit location on the device. Python/cirq format Each python file defines two variables: QUBIT_ORDER and CIRCUIT. The former is a python list object containing `cirq.GridQubit` objects initialized with therow and column of each qubit on the device. The latter is a `cirq.Circuit` object initialized with all gate operations contained in the circuit. The files have been tested using cirq version 1.2.0.dev20230613162638. The following code snippet illustrates how one can use cirq and our circuit definitions to compute output state amplitudes: $ python -i circuit_n70_m24_s00_patches3_pABCD_num_sq8_221014_phase_match.py >>> cirq.final_wavefunction(CIRCUIT, qubit_order=QUBIT_ORDER) array([ 0.00263724+0.00337646j, 0.0009332 +0.00111853j, -0.0007809 +0.00386362j, ..., 0.00574739-0.00027827j, -0.00254766+0.00299345j, 0.00396056+0.00312335j], dtype=complex64) See [3] for more details about cirq. QASM format Each QASM file has been generated using cirq and specifies the RQC decomposed into CNOT and single-qubit gates. The files have been generated using cirq. See [4] for more details about the format. Measurements file format Each line contains the bitstring obtained in a single execution of the RQC on Sycamore. The first, left-most position corresponds to the qubit 0 in QSIM format and the first qubit in the `QUBIT_ORDER` list in the python/cirq files. To visualize the patches After loading `CIRCUIT` from the appropriate `.py` file, the following code snippet can be used to visualize the patches: import cirq import matplotlib.pyplot as plt pairs = set() for moment in CIRCUIT: for op in moment.operations: q = op.qubits if len(q) > 1: assert len(q) == 2 pairs.add(tuple(sorted(q))) d = {p:1 for p in pairs} heatmap = cirq.TwoQubitInteractionHeatmap(d) _, ax = plt.subplots(figsize=(8, 8)) _ = heatmap.plot(ax) Visualize the activation patterns The activation pattern sequence can also be visualized in a similar manner. After loading `CIRCUIT` from the appropriate `.py` pyle, the following code snippet can be used to visualize the activation patterns: import cirq import matplotlib.pyplot as plt def has_two_qubit_gates(moment): has = False for op in moment.operations: if len(op.qubits) > 1: has = True break return has def plot_pairs(moment): pairs = set() for op in moment.operations: q = op.qubits if len(q) > 1: assert len(q) == 2 pairs.add( tuple(sorted(q)) ) d = {p:1 for p in pairs} heatmap = cirq.TwoQubitInteractionHeatmap(d) _, ax = plt.subplots(figsize=(8, 8)) _ = heatmap.plot(ax) return ax moments = [_ for _ in CIRCUIT if has_two_qubit_gates(_)] moment_to_visualize = moments[0] # iterate through this manually plot_pairs(moment_to_visualize) Content listing The dataset includes the following tarball files: n69_m04_patches2.tar.gz (80 files) n69_m04_patches3.tar.gz (80 files) n69_m06_patches2.tar.gz (80 files) n69_m06_patches3.tar.gz (80 files) n69_m08_patches2.tar.gz (80 files) n69_m08_patches3.tar.gz (80 files) n69_m10_patches2.tar.gz (80 files) n69_m10_patches3.tar.gz (80 files) n69_m12_patches2.tar.gz (80 files) n69_m12_patches3.tar.gz (80 files) n69_m14_patches2.tar.gz (80 files) n69_m14_patches3.tar.gz (80 files) n69_m16_patches2.tar.gz (80 files) n69_m16_patches3.tar.gz (80 files) n69_m18_patches2.tar.gz (80 files) n69_m18_patches3.tar.gz (80 files) n69_m20_patches2.tar.gz (80 files) n69_m20_patches3.tar.gz (80 files) n69_m22_patches2.tar.gz (80 files) n69_m22_patches3.tar.gz (80 files) n69_m24_patches1.tar.gz (4 files) n69_m24_patches2.tar.gz (80 files) n69_m24_patches3.tar.gz (80 files) n69_m26_patches2.tar.gz (80 files) n69_m26_patches3.tar.gz (80 files) n69_m28_patches2.tar.gz (80 files) n69_m28_patches3.tar.gz (80 files) n69_m30_patches2.tar.gz (80 files) n69_m30_patches3.tar.gz (80 files) n70_m16_patches2.tar.gz (960 files) n70_m16_patches3.tar.gz (1040 files) n70_m16_patches9.tar.gz (160 files) n70_m18_patches2.tar.gz (960 files) n70_m18_patches3.tar.gz (1040 files) n70_m18_patches9.tar.gz (160 files) n70_m20_patches2.tar.gz (960 files) n70_m20_patches3.tar.gz (1040 files) n70_m20_patches9.tar.gz (160 files) n70_m22_patches2.tar.gz (960 files) n70_m22_patches3.tar.gz (1040 files) n70_m22_patches9.tar.gz (160 files) n70_m24_patches1.tar.gz (56 files) n70_m24_patches2.tar.gz (960 files) n70_m24_patches3.tar.gz (1040 files) n70_m24_patches9.tar.gz (160 files) n70_m26_patches1.tar.gz (4 files) n70_m26_patches2.tar.gz (880 files) n70_m26_patches3.tar.gz (960 files) n70_m26_patches9.tar.gz (160 files)67-qubit data (described below) Additionally, the file Figures 2 and 3 data.zip contains processed data (9 files in Pickle format) that are shown in Figures 2 and 3 of the paper. The 67-qubit data files, n67_full.zip, n67_patches2.zip, and n67_patches3.zip are formatted differently. The circuits are savd in .json format and can be loaded with `cirq.read_json()`. The data files are in .npy format and can be opened with numpy.load(). The number of cycles (`m` elsewhere) is indicated after `d` in the filename. The contents of these zip files can be previewed with the "preview" button. References [1] Google AI Quantum and collaborators, "Phase transition in Random Circuit Sampling". arXiv:2304.11119 [2] Google AI Quantum and collaborators, Supplementary information for “Quantum supremacy using a programmable superconducting processor”. arXiv:1910.11333 [3] Cirq: A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits, https://github.com/quantumlib/Cirq. [4] Cross, Andrew W.; Bishop, Lev S.; Smolin, John A.; Gambetta, Jay M. "Open Quantum Assembly Language", arXiv:1707.03429 [5] Martinis, John M. et al. (2022), "Quantum supremacy using a programmable superconducting processor", Dryad, Dataset, https://doi.org/10.5061/dryad.k6t1rj8
本数据集定义了我们发表在论文《随机电路采样中的相变》中的随机量子电路(Random Quantum Circuits, RQCs),并列出了在Sycamore处理器上对这些电路进行实验执行时观测到的比特串。有关实验的更多细节详见参考文献[1]。本数据集的上传格式参考了[5]的规范。 ### 背景 #### 电路参数 本文发布的RQC可通过以下参数唯一标识: - `n`:量子比特数(取值为69、70), - `m`:电路周期数(取值为04、06、08……28、30), - `s`:伪随机数生成器的种子(取值为000、001……595), - `patches`:补丁(patches)数量, - `p`:耦合器激活模式序列(如`ABCD`、`ABCDCDAB`), - `num_sq`:不同单量子比特门的数量(取值为3、8), - 数据采集日期:以yymmdd格式编码在文件名中, - `phase_match`:若执行了相位匹配,则该字段会包含在文件名中。 有关耦合器激活模式的细节详见文献[2]中的图S25与文献[1]中的图3,有关补丁的示意图详见文献[1]中的图4。下文提供的代码片段可用于可视化给定电路的补丁与激活模式。 当`num_sq`为8时,单量子比特门从集合\(Z^p X^{1/2} Z^{-p}\)中随机选取,其中\(p in {-1, -3/4, -1/2, -1/4, 0, 1/4, 1/2, 3/4 }\);当`num_sq`为3时,单量子比特门则从\(sqrt X\)、\(sqrt Y\)与\(sqrt W\)中随机选取。相位匹配的相关说明详见文献[1]的附录C.1。请注意,共享同一种子`s`的电路拥有相同的初始门序列。 ### 内容说明 每个RQC对应数据集中的4个文件: 1. QSIM格式的原始RQC规范文件,命名为`circuit_*.qsim`, 2. 基于Cirq的Python代码形式的衍生RQC规范文件,命名为`circuit_*.py`, 3. QASM格式的衍生RQC规范文件,命名为`circuit_*.qasm`, 4. 实验中观测到的比特串文件,命名为`measurements_*.txt`。 上述文件名中的通配符`*`代表用于标识RQC的参数字符串。例如,`circuit_n70_m24_s00_patches3_pABCD_num_sq8_221014_phase_match.qasm`为QASM格式的文件,对应2022年10月14日采集的、70量子比特、24个周期、伪随机数生成器种子为0、3个补丁、耦合器激活模式序列为ABCD、包含8种不同单量子比特门且执行了相位匹配的RQC定义。 文件按照参数`n`、`m`与`patches`进行分组,并打包为压缩tarball文件。例如,压缩包`n69_m04_patches2.tar.gz`包含所有69量子比特、4个周期、2个补丁的RQC及其测量文件。 ### 电路文件格式 #### QSIM格式 首行指定量子比特数`n`。后续每一行代表一个单量子门,包含时序片编号、门名称以及一个或两个量子比特(以0到`n-1`之间的整数表示),可选择性跟随门参数。 本数据集使用的门包括: - `x_1_2`:无参数单量子比特门,对应布洛赫球上绕X轴的π/2旋转,详见文献[2]第七部分的公式(45), - `y_1_2`:无参数单量子比特门,对应布洛赫球上绕Y轴的π/2旋转,详见文献[2]第七部分的公式(46), - `hz_1_2`:无参数单量子比特门,对应布洛赫球上绕X+Y轴的π/2旋转,详见文献[2]第七部分的公式(47), - `rz`:单量子比特门,对应布洛赫球上绕Z轴的旋转,旋转角度由唯一参数以弧度指定, - `fsim`:双量子比特门,对应iSWAP与CPHASE门的复合操作,包含两个弧度制参数:theta(负iSWAP角度)与phi(CPHASE角度),详见文献[2]第七部分的公式(48)。 请注意,我们在Sycamore处理器上执行实验时使用的双量子比特门属于五参数族,该族门可保持量子比特的0与1态数目不变。此类门均可分解为1个`fsim`门与4个`rz`门。因此,一个包含一轮单量子比特门与一轮双量子比特门的完整周期,在文件中以4个时序片(moment)表示:第一个时序片包含`x_1_2`、`y_1_2`与`hz_1_2`门,其余三个时序片使用`rz`与`fsim`门描述实验中使用的双量子比特门。有关Sycamore门及其分解的更多细节详见文献[2]的第七部分。 量子比特以0到`n-1`的整数编号表示,因此无法直接反映其在处理器上的物理位置。 #### Python/Cirq格式 每个Python文件定义两个变量:`QUBIT_ORDER`与`CIRCUIT`。前者为Python列表对象,包含`cirq.GridQubit`实例,对应处理器上每个量子比特的行与列坐标。后者为`cirq.Circuit`实例,包含电路的所有门操作。本文件已在Cirq版本1.2.0.dev20230613162638下完成测试。 以下代码片段展示了如何使用Cirq与本数据集的电路定义计算输出态振幅: python $ python -i circuit_n70_m24_s00_patches3_pABCD_num_sq8_221014_phase_match.py >>> cirq.final_wavefunction(CIRCUIT, qubit_order=QUBIT_ORDER) array([ 0.00263724+0.00337646j, 0.0009332 +0.00111853j, -0.0007809 +0.00386362j, ..., 0.00574739-0.00027827j, -0.00254766+0.00299345j, 0.00396056+0.00312335j], dtype=complex64) 有关Cirq的更多细节详见文献[3]。 #### QASM格式 每个QASM文件均通过Cirq生成,将RQC分解为受控非(CNOT)门与单量子比特门。本文件通过Cirq生成。有关格式的更多细节详见文献[4]。 #### 测量文件格式 每一行代表在Sycamore处理器上单次执行RQC得到的比特串。最左侧的第一位对应QSIM格式中的量子比特0,同时对应Python/Cirq文件中`QUBIT_ORDER`列表的第一个量子比特。 ### 可视化代码 #### 补丁可视化 从对应的`.py`文件中加载`CIRCUIT`后,可使用以下代码片段可视化补丁: python import cirq import matplotlib.pyplot as plt pairs = set() for moment in CIRCUIT: for op in moment.operations: q = op.qubits if len(q) > 1: assert len(q) == 2 pairs.add(tuple(sorted(q))) d = {p:1 for p in pairs} heatmap = cirq.TwoQubitInteractionHeatmap(d) _, ax = plt.subplots(figsize=(8, 8)) _ = heatmap.plot(ax) #### 激活模式可视化 激活模式序列也可通过类似方式可视化。从对应的`.py`文件中加载`CIRCUIT`后,可使用以下代码片段可视化激活模式: python import cirq import matplotlib.pyplot as plt def has_two_qubit_gates(moment): has = False for op in moment.operations: if len(op.qubits) > 1: has = True break return has def plot_pairs(moment): pairs = set() for op in moment.operations: q = op.qubits if len(q) > 1: assert len(q) == 2 pairs.add( tuple(sorted(q)) ) d = {p:1 for p in pairs} heatmap = cirq.TwoQubitInteractionHeatmap(d) _, ax = plt.subplots(figsize=(8, 8)) _ = heatmap.plot(ax) return ax moments = [_ for _ in CIRCUIT if has_two_qubit_gates(_)] moment_to_visualize = moments[0] # 手动遍历该列表 plot_pairs(moment_to_visualize) ### 内容列表 本数据集包含以下压缩tarball文件: `n69_m04_patches2.tar.gz`(80个文件) `n69_m04_patches3.tar.gz`(80个文件) `n69_m06_patches2.tar.gz`(80个文件) `n69_m06_patches3.tar.gz`(80个文件) `n69_m08_patches2.tar.gz`(80个文件) `n69_m08_patches3.tar.gz`(80个文件) `n69_m10_patches2.tar.gz`(80个文件) `n69_m10_patches3.tar.gz`(80个文件) `n69_m12_patches2.tar.gz`(80个文件) `n69_m12_patches3.tar.gz`(80个文件) `n69_m14_patches2.tar.gz`(80个文件) `n69_m14_patches3.tar.gz`(80个文件) `n69_m16_patches2.tar.gz`(80个文件) `n69_m16_patches3.tar.gz`(80个文件) `n69_m18_patches2.tar.gz`(80个文件) `n69_m18_patches3.tar.gz`(80个文件) `n69_m20_patches2.tar.gz`(80个文件) `n69_m20_patches3.tar.gz`(80个文件) `n69_m22_patches2.tar.gz`(80个文件) `n69_m22_patches3.tar.gz`(80个文件) `n69_m24_patches1.tar.gz`(4个文件) `n69_m24_patches2.tar.gz`(80个文件) `n69_m24_patches3.tar.gz`(80个文件) `n69_m26_patches2.tar.gz`(80个文件) `n69_m26_patches3.tar.gz`(80个文件) `n69_m28_patches2.tar.gz`(80个文件) `n69_m28_patches3.tar.gz`(80个文件) `n69_m30_patches2.tar.gz`(80个文件) `n69_m30_patches3.tar.gz`(80个文件) `n70_m16_patches2.tar.gz`(960个文件) `n70_m16_patches3.tar.gz`(1040个文件) `n70_m16_patches9.tar.gz`(160个文件) `n70_m18_patches2.tar.gz`(960个文件) `n70_m18_patches3.tar.gz`(1040个文件) `n70_m18_patches9.tar.gz`(160个文件) `n70_m20_patches2.tar.gz`(960个文件) `n70_m20_patches3.tar.gz`(1040个文件) `n70_m20_patches9.tar.gz`(160个文件) `n70_m22_patches2.tar.gz`(960个文件) `n70_m22_patches3.tar.gz`(1040个文件) `n70_m22_patches9.tar.gz`(160个文件) `n70_m24_patches1.tar.gz`(56个文件) `n70_m24_patches2.tar.gz`(960个文件) `n70_m24_patches3.tar.gz`(1040个文件) `n70_m24_patches9.tar.gz`(160个文件) `n70_m26_patches1.tar.gz`(4个文件) `n70_m26_patches2.tar.gz`(880个文件) `n70_m26_patches3.tar.gz`(960个文件) `n70_m26_patches9.tar.gz`(160个文件) 67量子比特数据集(详见下文) 此外,文件`Figures 2 and 3 data.zip`包含论文中图2与图3所用的处理后数据(共9个Pickle格式文件)。 67量子比特数据集的文件`n67_full.zip`、`n67_patches2.zip`与`n67_patches3.zip`格式有所不同:电路以`.json`格式存储,可通过`cirq.read_json()`加载;数据文件为`.npy`格式,可通过`numpy.load()`读取。文件名中`d`后的数值代表电路周期数`m`。可通过“预览”按钮预览这些压缩包的内容。 ### 参考文献 [1] Google AI Quantum 及合作者, "Phase transition in Random Circuit Sampling". arXiv:2304.11119 [2] Google AI Quantum 及合作者, 《使用可编程超导处理器实现量子优越性》补充材料. arXiv:1910.11333 [3] Cirq: 用于创建、编辑与调用有噪中等规模量子(Noisy Intermediate-Scale Quantum, NISQ)电路的Python框架, https://github.com/quantumlib/Cirq. [4] Cross, Andrew W.; Bishop, Lev S.; Smolin, John A.; Gambetta, Jay M. "Open Quantum Assembly Language", arXiv:1707.03429 [5] Martinis, John M. et al. (2022), "Quantum supremacy using a programmable superconducting processor", Dryad, Dataset, https://doi.org/10.5061/dryad.k6t1rj8



