Comments (3)
Hello @CSNWEB , unlike in other numerical experiments, this function
acqdp/demo/QAOA/qaoa.py at a8bd68e0a73814643e815f461c74a759858780cb · alibaba/acqdp
directly translates a QAOA problem to a tensor network representing the ``lightcone'' of a set of qubits. Unfortunately, it is not possible to generate a unique quantum circuit from a json file representing a tensor network.
For all the numerical experiments mentioned in the original paper, we were given the option to utilize a code capsule. The specific version of the ACQDP package, along with scripts that replicate the results reported in the paper, is accessible at Code Ocean capsule.
You can find the input file and shell commands we ran at https://codeocean.com/capsule/8055748/tree/v3. The command line for CFI is
python -m demo.QAOA.qaoa_demo ../data/QAOA/cfi.json 6 > ../results/QAOA_cfi.result
For random circuit sampling tasks, the command line is
python -m examples.circuit_simulation ../data/SUPREMACY/circuit_n53_m12_s0_e0_pABCDCDAB.qsim -o ../data/SUPREMACY/m12_1.json > ../results/SUPREMACY_m12_1.result
Let me know if you have any further questions.
from acqdp.
Hi, I work with @CSNWEB.
Thank you for your answer!
I have another question relating to this.
We've tried using the qaoa_demo script to generate tensor networks from the CFI circuits. We've managed to get the subscripts, but the tensor data (the numpy arrays) seem to be None. Where can we get the tensor data from?
Our attempt so far looks like this:
from . import qaoa
import json
import numpy as np
from sys import argv
exp_name = argv[1]
with open(exp_name, 'r') as f:
graphs = json.load(f)
num_layers = int(argv[2])
random_angles = np.random.uniform(0, 2 * np.pi, 2 * num_layers)
energy_list = []
a = qaoa.QAOAOptimizer({tuple(e): np.array([[1, -1], [-1, 1]]) for e in graphs['edges']}, num_layers=num_layers)
tn = a.preprocess(**graphs)[0]
inputs, output, shapes = tn.subscripts()
print(inputs)
print(output)
print(shapes)
tensors = [node['tensor']._data for node in tn.nodes.values()]
print(tensors)
Run with python -m demo.QAOA.qaoa_demo ../data/QAOA/tn_CFI_I_blue_4.json 6
from acqdp.
The tensor data are not determined until QAOAOptimizer.query
is called with a concrete set of params, at which point query
calls decorate
to fill in the data.
from acqdp.
Related Issues (14)
- Examples are wrong or inaccurate
- ValueError: too many enisum subscripts
- cut_kKaHyPar_sea20.ini is not found when package is installed HOT 2
- No documentation for "circuit_file" in example HOT 6
- Documentation about how to construct a circuit? HOT 1
- Could you add more detailed example of how to use getDeployPlugin() feature? HOT 2
- visualization of the tensor graph and the contraction tree HOT 2
- Possible bug HOT 2
- 实测结果问题 HOT 3
- How to perform a measurement in acqdp? HOT 2
- ContractionTree.branch_info() returns empty list when slicing is applied HOT 3
- KHP order finder halts with "Invalid object identifier" HOT 3
- TensorNetwork.find_order() returns None when cost/cw is high HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acqdp.