Notepad/enter/Machine Tips (Quantum)/Math/Algorithms/Alg Collection/How many qubits do I need?.md

48 lines
1.1 KiB
Markdown
Raw Normal View History

2023-07-05 18:29:11 +00:00
via Xanadu.ai's [pennylane](https://pennylane.ai/) software.
#### How many qubits/gates do I need to run this algorithm?
module for estimating through process of first and second quantization:
```
# first quantization
>>> n = 100000 # number of plane waves
>>> eta = 156 # number of electrons
>>> omega = 1145.166 # unit cell volume in atomic units
>>> algo = FirstQuantization(n, eta, omega)
>>> algo.gates
1.10e+13
>>> algo.qubits
4416
```
```
# second quantization with double factored Hamiltonian
# Hamiltonia
symbols = ['O', 'H', 'H']
geometry = np.array([[0.00000000, 0.00000000, 0.28377432],
[0.00000000, 1.45278171, -1.00662237],
[0.00000000, -1.45278171, -1.00662237]], requires_grad = False)
mol = qml.qchem.Molecule(symbols, geometry, basis_name='sto-3g')
core, one, two = qml.qchem.electron_integrals(mol)()
algo = DoubleFactorization(one, two)
```
```
```
and voila!
```
>>> print(algo.gates, algo.qubits)
103969925, 290
```
and even more capabilities are available the more you explore! :)