ProjectQ-Framework / ProjectQ

ProjectQ: An open source software framework for quantum computing
https://projectq.ch
Apache License 2.0
874 stars 271 forks source link

About Time Evolution gate #377

Open quantum-rookie opened 4 years ago

quantum-rookie commented 4 years ago

Hello, I have some questions for Time Evolution gate. i'm learning VQE( variational quantum eigensolver). Through the second quantization, I get an interaction term(U) with one parameter(θ),for example U = exp(-iθZ0Z1) . Z0 and Z1 are Pauli operators acting on qubit0 and qubit1 respectively. I want to achieve U = exp(-iθZ0Z1) by Time Evolution gate.

wavefunction = eng.allocate_qureg(2) ansatz = QubitOperator('Z0 Z1') TimeEvolution(theta, ansatz) | wavefunction

Is this ok?

The most important quesion is i wonder how to achieve U = exp(-iθZ0Z1) by some universal quantum gates in quantum circuit? In other words, Is there any way to decompose u into some universal quantum gates?