All my data in the 2.1 OpenQASM spec. Added to the qasm-parser/examples/example_data/tfi_and_xxz_chain directory.
The files tfim_chain_generate_qasm_file.py, tfim_rect_generate_qasm_file.py and xxz_chain_generate_qasm_file.pywhich can be used to generate these .qasm files.
The script verify_data.py to verify the circuits. I apply the following steps:
Read in a .qasm file (1dtfi, 1dxxz or 2dtfi).
Convert it to a qdata tree.
Extract the energy operators and circuits from the qdata tree (very hacky right now).
Convert the energy operators to Cirq Pauli sums and convert the energy operators to Cirq circuits.
Then we execute the circuit, measure the operators, and compare it with the ground truth, obtained from https://github.com/therooler/tfq_data
We check a subset of 10 circuits for all systems and all system sizes.
The verify_data.py script can potentially be converted to a pytest script, but it takes a while to run.
I think the spec work pretty well already, but as I commented in issue #23, there are cases where the gate or energy definitions contains a mixture of Terms,Gates andOp` objects where you expect only one type of object.
This pull request contains the following things:
All my data in the 2.1 OpenQASM spec. Added to the
qasm-parser/examples/example_data/tfi_and_xxz_chain
directory.The files
tfim_chain_generate_qasm_file.py
,tfim_rect_generate_qasm_file.py
andxxz_chain_generate_qasm_file.py
which can be used to generate these .qasm files.The script
verify_data.py
to verify the circuits. I apply the following steps:https://github.com/therooler/tfq_data
The
verify_data.py
script can potentially be converted to a pytest script, but it takes a while to run.I think the spec work pretty well already, but as I commented in issue #23, there are cases where the gate or energy definitions contains a mixture of Term
s,
Gates and
Op` objects where you expect only one type of object.