Closed PietropaoloFrisoni closed 2 months ago
Hi @PietropaoloFrisoni, yes general 3+ qubit gates are not supported for MPS currently, though there are not fundamental barriers to implementing. See also #185.
I'm not sure I have time to implement this imminently, but the general flow would be:
tensor_network_1d_compress
functionality (https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/tensor_1d_compress/index.html)Thanks again!
Multi-qubit gates are now handled by CircuitMPS
via an MPO representation. It currently works via the dense representation so things like n-controlled gates which have a direct low-rank MPO representation are not implemented yet.
Awesome! Thanks a lot!
@jcmgray By the way, I notice that the error ValueError: too many values to unpack (expected 2)
is still raised if we use the option: contract='swap+split'
. Is it intentional?
Namely, it seems to me that 3+ qubit gates expect the contract='nonlocal'
option. If that's the case, then according to the documentation the difference between contract='auto-mps'
and contract='swap+split'
is only for 2-qubit gates? Thanks again for the quick implementation :+1:
Yes the swap+split
method does not itself support 3+ qubit gates yet - though I'm sure there's a natural way to do it. Currently there is no difference between 'auto-mps'
and 'swap+split'
, other than the first supports 3+ qubit gates! But it the future it might be more intelligent, for example, the nonlocal
method is more expensive for a given max_bond
/ cutoff
but achieves a better fidelity.
@jcmgray One last question: have you decided when quimb 1.8.1
will be officially released?
I will try and release a new version in the coming days.
What is your issue?
Good morning, I hope you are doing well.
I have a simple question regarding applying raw gates to
CircuitMPS
. In a nutshell, it seems to me that it does not work for 3 or 4 qubit gates.The code below is a minimal example that shows the issue. I am importing the quantum gates from pennylane, but all that
quimb
receives is the corresponding matrix and the qubits it acts on.Am I missing something? Thank you so much in advance for your time, and congratulations on developing
quimb
!Edit: I forgot to specify, but the error comes from line
1863
oftensor_1d.py
:ValueError: too many values to unpack (expected 2)
. I am usingquimb 1.7.3
.