-
Notifications
You must be signed in to change notification settings - Fork 4
Example: Dynamic simulation
Vu Tuan Hai edited this page Feb 26, 2024
·
1 revision
In this post, we consider to prepare such unitary matrix:
import numpy as np
# Vector form
U = np.array(np.random.uniform(size=2**2))
# Matrix form
theta = np.pi/2
U = np.array([[1, 0, 0, 0],
[0, np.cos(theta), 0, np.sin(theta)],
[0, 0, 1, 0],
[0, np.sin(theta), 0, -np.cos(theta)]]
)
We prepare U by the default ansatz
compiler = QuantumStatePreparation.prepare(U)
Then, the compiler stores
Copyright @ 2024 Hai et al
- Home
- Contribute guideline
- Installation guideline
- Package requirements
- Core
- GA-QAS
- Example
- Advanced