Closed SSSSSCV closed 1 year ago
also encountered this bug
Traceback (most recent call last): File "main.py", line 79, in <module> main() File "main.py", line 65, in main cut_bitstring, _ = find_cut(G, p, ITR, LR, print_loss=True, plot=True) File "c:\dropbox\python\quantum\quantum\paddle_quantum\QAOA\maxcut.py", line 87, in find_cut loss = -loss_func(state) File "C:\Users\user\anaconda3\envs\qnet_env\lib\site-packages\paddle\fluid\dygraph\layers.py", line 930, in __call__ return self._dygraph_call_func(*inputs, **kwargs) File "C:\Users\user\anaconda3\envs\qnet_env\lib\site-packages\paddle\fluid\dygraph\layers.py", line 915, in _dygraph_call_func outputs = self.forward(*inputs, **kwargs) File "c:\dropbox\python\quantum\quantum\paddle_quantum\loss\measure.py", line 117, in forward output_state = paddle.einsum('ia, ab->ib', matrix, _state_data).reshape([2 ** num_qubits]) File "C:\Users\user\anaconda3\envs\qnet_env\lib\site-packages\paddle\tensor\einsum.py", line 993, in einsum return einsum_v2(equation, *operands) File "C:\Users\user\anaconda3\envs\qnet_env\lib\site-packages\paddle\tensor\einsum.py", line 776, in einsum_v2 return gen_einsum_op(lhs + '->' + rhs, *operands) File "C:\Users\user\anaconda3\envs\qnet_env\lib\site-packages\paddle\tensor\einsum.py", line 805, in gen_einsum_op return _C_ops.einsum(operands, RuntimeError: (NotFound) There are no kernels which are registered in the einsum operator. [Hint: Expected kernels_iter != all_op_kernels.end(), but received kernels_iter == all_op_kernels.end().] (at C:\home\workspace\Paddle_release\paddle\fluid\imperative\prepared_operator.cc:341) [operator < einsum > error]
this exsample: cd paddle_quantum/QAOA/example python main.py
and TSP problem error in loss_func
def loss_func(cir: Circuit, H: Hamiltonian) -> paddle.Tensor: state = cir() loss = paddle_quantum.loss.ExpecVal(H) return loss(state) <-- HERE
The function paddle.einsum in PaddlePaddle 2.3.1 does not work properly for complex tensors. Thus the problem should be solved by downgrading your PaddlePaddle version to 2.3.0.
on default installed 2.3.2
when I try install PaddlePaddle 2.3.0
python -m pip install PaddlePaddle 2.3.0
got error:
Collecting PaddlePaddle
Using cached paddlepaddle-2.3.2-cp39-cp39-win_amd64.whl (64.3 MB)
ERROR: Could not find a version that satisfies the requirement 2.3.0 (from versions: none)
ERROR: No matching distribution found for 2.3.0
How install 2.3.0 ?
Install it with - python -m pip install PaddlePaddle 2.3.0 fork fine! thx
but. how to connect to real quantum computer for comparision performance for TSP example ?
I try set backend:
paddle_quantum.set_backend('quleaf')
and got error :
Traceback (most recent call last):
File "C:\Dropbox\Python\Quantum\tsp.py", line 98, in
This is a bug. Briefly, it will occur when your circuit has no trainable parameters.
without backend bug not appears.
but the backend set leads to failure TSP example:
paddle_quantum.set_backend('quleaf')
It only occurs when the backend is quleaf.
please advise correct backend ?
If you want to use the simulator, you can choose the 'state_vector' or 'density_matirx'. If you want to use the real quantum computer, you can just choose the 'quleaf' backend.
hm. I do that, but not work. tutorials not work with real quleaf backend ? only simulations ?
This bug has been fixed by the latest version of PaddleQuantum. Note that token is required to access QPU. See here for more details.
运行官网上的QGAN的例子时出现这个错误,运行失败。
![image](https://user-images.githubusercontent.com/49343347/186586615-a634ce69-c3e3-4653-ba40-5dea75647564.png)