Convert an external wavefunction to a state vector.
The sources of wavefunctions that are currently accepted are listed below.
The PySCF library (the restricted and unrestricted CISD/CCSD methods are supported). The solver argument is then the associated PySCF CISD/CCSD Solver object.
The library Dice implementing the SHCI method. The solver argument is then the tuple(list[str], array[float]) of Slater determinants and their coefficients.
The library Block2 implementing the DMRG method. The solver argument is then the tuple(list[int], array[float]) of Slater determinants and their coefficients.
solver – external wavefunction object
tol (float) – the tolerance for discarding Slater determinants based on their coefficients
ValueError – if external object type is not supported
normalized state vector of length \(2^M\), where \(M\) is the number of spin orbitals
- Return type
>>> from pyscf import gto, scf, ci >>> mol = gto.M(atom=[['H', (0, 0, 0)], ['H', (0,0,0.71)]], basis='sto6g') >>> myhf = scf.UHF(mol).run() >>> myci = ci.UCISD(myhf).run() >>> wf_cisd = qml.qchem.import_state(myci, tol=1e-1) >>> print(wf_cisd) [ 0. +0.j 0. +0.j 0. +0.j 0.1066467 +0.j 0. +0.j 0. +0.j 0. +0.j 0. +0.j 0. +0.j 0. +0.j 0. +0.j 0. +0.j -0.99429698+0.j 0. +0.j 0. +0.j 0. +0.j]
- What is PennyLane?
- Quantum circuits
- Gradients and training
- Quantum operators
- Inspecting circuits
- Compiling circuits
- Quantum Chemistry
- Quantum Datasets
- QNode returns