Skip to content

Commit

Permalink
Fixed default value for output_logs and fixed redundant code in chemi…
Browse files Browse the repository at this point in the history
…stry_benchmark.py

Signed-off-by: Jerimiah <Jerimiah.wright@utexas.edu>
  • Loading branch information
Jeriimiah committed Jun 5, 2020
1 parent 6e32ae1 commit 2e4caea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions python/benchmark/chemistry/chemistry_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ def execute(self, inputParams):
elif inputParams['Observable']['name'] == 'fermion':
obs_str = inputParams['Observable']['obs_str']
H = xacc.getObservable('fermion', obs_str)
elif inputParams['Observable']['name'] == 'psi4':
elif inputParams['Observable']['name'] in ['pyscf','psi4']:
opts = {'basis':inputParams['Observable']['basis'], 'geometry':inputParams['Observable']['geometry']}
if 'fo' in inputParams['Observable'] and 'ao' in inputParams['Observable']:
opts['frozen-spin-orbitals'] = ast.literal_eval(inputParams['Observable']['fo'])
opts['active-spin-orbitals'] = ast.literal_eval(inputParams['Observable']['ao'])
H = xacc.getObservable('psi4', opts)
elif inputParams['Observable']['name'] == 'pyscf':
opts = {'basis':inputParams['Observable']['basis'], 'geometry':inputParams['Observable']['geometry']}
if 'fo' in inputParams['Observable'] and 'ao' in inputParams['Observable']:
opts['frozen-spin-orbitals'] = ast.literal_eval(inputParams['Observable']['fo'])
opts['active-spin-orbitals'] = ast.literal_eval(inputParams['Observable']['ao'])
H = xacc.getObservable('pyscf', opts)
H = xacc.getObservable(inputParams['Observable']['name'], opts)

#print('Ham: ', H.toString())
qpu = xacc.getAccelerator(acc_name, xacc_opts)
Expand Down
2 changes: 1 addition & 1 deletion python/xacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def benchmark(xacc_settings):
tail)[0], timestr)

if 'output_logs' not in xacc_settings['Benchmark']:
xacc_settings['Benchmark']['output_logs'] = False
xacc_settings['Benchmark']['output_logs'] = True

if xacc_settings['Benchmark']['output_logs'] == True:
f = open(results_name+".ab", 'w')
Expand Down

0 comments on commit 2e4caea

Please sign in to comment.