Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantum circuit from MPS #487

Open
sajjan02purdue opened this issue Nov 17, 2023 · 5 comments
Open

Quantum circuit from MPS #487

sajjan02purdue opened this issue Nov 17, 2023 · 5 comments

Comments

@sajjan02purdue
Copy link

Hi,
I am a regular user of ITensor new to Yao. I am wondering if the package has the functionality of producing an approximate quantum circuit of one and two qubit gates given an MPS (may be imported from ITensor etc from a DMRG calculation). There are couple of papers along that line that has been published in recent years like

https://arxiv.org/abs/2209.00595

https://journals.aps.org/pra/abstract/10.1103/PhysRevA.101.032310

I want to use Yao for a similar purpose, so I was wondering if there is inherent support for doing that here. Any help will be appreciated.

@GiggleLiu
Copy link
Member

GiggleLiu commented Nov 17, 2023

Hi, the short answer is no inherent support for doing that.

The strategy of converting an MPS to a quantum circuit can be straight-forward. You just first canonicalize the MPS, and then compile each unitary to a quantum circuit. However, compiling generic n-qubit unitary to a quantum circuit is very inefficient, which requires exponential many gates. A straight-forward approach is:

  1. decompose a unitary gate into a sequence of two-level unitary gates, which is basically a multi-control unitary gate.
  2. decompose a multi-control unitary gate into basic gates.

Alternatively, you could use the variational approach to approximate the gate. For example, the following paper used Yao and the code is available on Github:
https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.1.023025

@talentkeychen
Copy link

talentkeychen commented Aug 6, 2024

Hi Prof Liu, can I follow up with your comments above?

Alternatively, you could use the variational approach to approximate the gate. For example, the following paper used Yao and the code is available on Github: https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.1.023025

Do you mean that you use the variational approach to approximate the whole target state (say a N-site GHZ state) with your ansatz or just certain operator with your ansatz?

Thanks!

@GiggleLiu
Copy link
Member

GiggleLiu commented Aug 6, 2024

The whole state, please check the this code repo: https://github.com/frankwswang/MSQR.jl , which is a part of our unpublished work.
It is about learning a quantum state with a MPS like circuit, with swap test.

@talentkeychen

@talentkeychen
Copy link

Thanks for sharing your latest code here! I think I did not ask clearly enough before, but my question is that you also approximate the MPS with a quantum circuit using some kind of gradient descent in Eq. (3)?

@GiggleLiu
Copy link
Member

Thanks for sharing your latest code here! I think I did not ask clearly enough before, but my question is that you also approximate the MPS with a quantum circuit using some kind of gradient descent in Eq. (3)?

Yes. We can use of the parameter shift rule to compute the gradient of the overlap function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants