-
Notifications
You must be signed in to change notification settings - Fork 0
/
optimize-qcbm-circuit.yaml
101 lines (95 loc) · 3.63 KB
/
optimize-qcbm-circuit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ZapOSApiVersion: v1alpha1
kind: Workflow
resources:
- name: z-quantum-core
type: git
parameters:
url: "[email protected]:zapatacomputing/z-quantum-core.git"
branch: "master"
- name: z-quantum-qcbm
type: git
parameters:
url: "[email protected]:liweintu/z-quantum-qcbm.git"
branch: "master"
- name: z-quantum-optimizers
type: git
parameters:
url: "[email protected]:zapatacomputing/z-quantum-optimizers.git"
branch: "master"
- name: qe-forest
type: git
parameters:
url: "[email protected]:zapatacomputing/qe-forest.git"
branch: "master"
- name: qe-qhipster
type: git
parameters:
url: "[email protected]:zapatacomputing/qe-qhipster.git"
branch: "master"
- name: qe-openfermion
type: git
parameters:
url: "[email protected]:zapatacomputing/qe-openfermion.git"
branch: "master"
# Specify the prefix to use when generating names of workflow executions.
metadata:
generateName: qcbm-opt-
# The actual workflow specification
spec:
entrypoint: main
arguments:
parameters:
- s3-bucket: quantum-engine
- s3-key: projects/z-quantum-qcbm/qcbm-opt
- docker-image: 'z-quantum-default'
templates:
- name: main
steps:
- - name: get-initial-parameters
template: generate-random-qcbm-params
arguments:
parameters:
- n-qubits: "4"
- seed: "1234"
- n-layers: "3"
- min-val: "-1.57"
- max-val: "1.57"
- resources: [z-quantum-core, z-quantum-qcbm]
- docker-image: "{{workflow.parameters.docker-image}}"
- - name: optimize-circuit
template: optimize-variational-qcbm-circuit
arguments:
parameters:
- n-qubits: "4"
- single-qubit-gate: "Rx"
- static-entangler: "XX"
- epsilon: "0.000001"
- backend-specs: "{'module_name': 'qeforest.simulator', 'function_name': 'ForestSimulator', 'device_name': 'wavefunction-simulator'}"
- optimizer-specs: "{'module_name': 'zquantum.optimizers.cma_es_optimizer', 'function_name': 'CMAESOptimizer', 'options': {'popsize': 5, 'sigma_0': 0.1, 'tolx': 1e-6}}"
# - optimizer-specs: "{'module_name': 'zquantum.optimizers.scipy_optimizer', 'function_name': 'ScipyOptimizer', 'method': 'L-BFGS-B'}"
- resources: [z-quantum-core, qe-openfermion, z-quantum-optimizers, qe-forest, z-quantum-qcbm]
- docker-image: "{{workflow.parameters.docker-image}}"
- memory: 2048Mi
artifacts:
- initial-parameters:
from: "{{steps.get-initial-parameters.outputs.artifacts.parameters}}"
- target-distribution:
raw:
data: |
{"bitstring_distribution": {"0000": 1.0,
"0001": 0.0,
"0010": 0.0,
"0011": 1.0,
"0100": 0.0,
"0101": 1.0,
"0110": 0.0,
"0111": 0.0,
"1000": 0.0,
"1001": 0.0,
"1010": 1.0,
"1011": 0.0,
"1100": 1.0,
"1101": 0.0,
"1110": 0.0,
"1111": 1.0},
"schema": "io-ZapOS-v1alpha1-bitstring-distribution"}