geom = '''
Na 0.0 0.0 0.0
H 0.0 0.0 1.914388
'''
fo = [0, 1, 2, 3, 4, 10, 11, 12, 13, 14]
ao = [5, 9, 15, 19]
H = createOperator('pyscf', {'basis': 'sto-3g', 'geometry': geom,
'frozen-spin-orbitals': fo, 'active-spin-orbitals': ao})
energy = ansatz.observe(H, qalloc(4), 1.234)
Repro test case:
This will eventually invoke
qreg::weighted_sum, which assumes the observable is of Pauli-type.Note: the workaround is to explicitly apply
operatorTransform("jw", H)