问题标签 [tensorflow-quantum]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
185 浏览

python - tensorflow 2.3.1 和 cirq 之间的 protobuf 版本冲突

目前开始学习 TFQ 并一直在尝试做这个tensorflow 作者的教程,但是如果我运行第一行 (!pip install -q tensorflow==2.3.1 --user) 我得到这个错误:

错误:pip 的依赖解析器当前不考虑所有已安装的包。此行为是以下依赖冲突的根源。cirq 0.8.0 需要 protobuf==3.8.0,但您有 protobuf 3.15.7,这是不兼容的。

当我运行第二行(!pip install -q tensorflow-quantum --user)时,我得到了这个:

错误:pip 的依赖解析器当前不考虑所有已安装的包。此行为是以下依赖冲突的根源。tensorflow 2.3.1 需要 protobuf>=3.9.2,但是你有 protobuf 3.8.0 是不兼容的。

Cirq 0.8.0 想要 protobuf 3.8.0;tensorflow 2.3.1 想要 protobuf>=3.9.2 并且中间没有任何东西,当我执行“pip freeze”时,我只看到 protobuf==3.8.0,所以我的 pip freeze 看不到 protobuf 3.15.7 版本错误提到(当我执行“pip show protobuf”时,我得到了与版本 3.8.0 相同的结果)。

我应该怎么做才能防止这种冲突?

注意:Python 版本 = 3.7.9(无法使用 3.8 或 3.9 安装 tf 和/或 tfq);操作系统 = Windows 10

0 投票
0 回答
43 浏览

tensorflow-quantum - tfq.layers.PQC 中的quantum_data 是什么?

我无法理解为什么需要quantum_data属性。PQC 层将量子电路转换为 TensorFlow 层。这意味着电路中的所有自由参数都成为层的参数。现在要查看层的输出,我必须传递quantum_data属性。我不明白为什么我们需要这个。

输出应该是基于电路中参数/角度的随机初始化的一些随​​机期望值。谁能解释一下?

这是 Tensorflow 网站上的示例

0 投票
0 回答
102 浏览

tensorflow - tensorflow、tensorflow-quantum、grpcio 依赖冲突

我安装tensorflow-quantum并收到以下错误:

tensorflow-quantum 0.5.0 requires grpcio==1.30.0, but you have grpcio 1.32.0 which is incompatible.

所以,我安装了grpcio 1.30.0,但随后出现以下错误:

tensorflow 2.4.1 requires grpcio~=1.32.0, but you have grpcio 1.30.0 which is incompatible.

这些依赖冲突似乎是循环的。我应该怎么办?

0 投票
0 回答
31 浏览

tensorflow-quantum - tfq 和 ionq:ValueError:试图序列化不只使用 cirq.GridQubits 的电路

似乎 tfq 不喜欢cirq.LineQubitionq 电路中所需的布局,tfq.layers.SampledExpectation抛出

ValueError: Attempted to serialize circuit that don't use only cirq.GridQubits.

任何想法/解决方法?