question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for vectors of parameters

See original GitHub issue

Some circuits need to make use of a large, fixed number of parameters. For example, variational algorithms setting rotation angles as independent parameters, to be sourced as an array from a classical optimizer. See the VariationalForm class and RYRZ algorithm in aqua as an example.

https://github.com/Qiskit/qiskit-aqua/blob/40218c2e6ea6c76791139101ac005b9a2bf7b256/qiskit/aqua/components/variational_forms/ryrz.py

With the current Parameter definition, this is possible but cumbersome. It requires the user to define, name and manage a Parameter instance for each gate they plan to vary.

It should be possible to define a parameter vector of fixed length, and access elements of that vector as individual parameters.

Possible syntax:

v = ParameterVector('v', 99)

v[10] # => Parameter(v[10])

qc = QuantumCircuit(3)
qr = qc.qregs[0]

for (t1, t2, t3) in zip(v[::3], v[1::3], v[2::3]):
  qc.cx(qr[:-1], qr[1:])
  qc.u3(t1, t2, t3, qr[0])

qc.bind_parameters({v = [...]}) 

When binding, we should verify that the supplied list matches the length of the vector and that all parameters in the vector are bound. (Partial binding within a vector is not supported.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dongreenbergcommented, May 14, 2019

Just to close this loop before I submit, the interface now looks like:

        qubits = 5
        depth = 4
        ryrz = QuantumCircuit(qubits, name='ryrz')
        theta = ParameterVector('ΞΈ0', length=len(ryrz.qubits) * 2)
        theta_iter = iter(theta)
        for q in ryrz.qubits:
            ryrz.ry(next(theta_iter), q)
            ryrz.rz(next(theta_iter), q)

        cxs = QuantumCircuit(qubits-1, name='cxs')
        for i, q in enumerate(cxs.qubits[:-1:2]):
            cxs.cx(cxs.qubits[2*i], cxs.qubits[2*i+1])

        paramvecs = [theta]
        qc = QuantumCircuit(qubits)
        for i in range(depth):
            theta_l = ParameterVector('ΞΈ{}'.format(i+1), length=len(ryrz.qubits) * 2)
            ryrz_inst = ryrz.to_instruction(parameter_map={theta: theta_l})
            paramvecs += [theta_l]
            qc.append(ryrz_inst, qargs=qc.qubits)
            qc.append(cxs, qargs=qc.qubits[1:])
            qc.append(cxs, qargs=qc.qubits[:-1])
            qc.barrier()

        print(qc.decompose().draw(line_length=1000))
        print(qc.draw(line_length=1000))
        backend = BasicAer.get_backend('qasm_simulator')
        qc_aer = transpile(qc, backend)
        print(qc_aer.draw(line_length=1000))

producing:

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ 
q_0: |0>─ Ry(ΞΈ1[0]) β”œβ”€ Rz(ΞΈ1[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ2[0]) β”œβ”€ Rz(ΞΈ2[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ3[0]) β”œβ”€ Rz(ΞΈ3[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ4[0]) β”œβ”€ Rz(ΞΈ4[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ 
q_1: |0>─ Ry(ΞΈ1[2]) β”œβ”€ Rz(ΞΈ1[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ Ry(ΞΈ2[2]) β”œβ”€ Rz(ΞΈ2[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ Ry(ΞΈ3[2]) β”œβ”€ Rz(ΞΈ3[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ Ry(ΞΈ4[2]) β”œβ”€ Rz(ΞΈ4[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ 
q_2: |0>─ Ry(ΞΈ1[4]) β”œβ”€ Rz(ΞΈ1[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ2[4]) β”œβ”€ Rz(ΞΈ2[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ3[4]) β”œβ”€ Rz(ΞΈ3[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ4[4]) β”œβ”€ Rz(ΞΈ4[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ 
q_3: |0>─ Ry(ΞΈ1[6]) β”œβ”€ Rz(ΞΈ1[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ Ry(ΞΈ2[6]) β”œβ”€ Rz(ΞΈ2[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ Ry(ΞΈ3[6]) β”œβ”€ Rz(ΞΈ3[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ Ry(ΞΈ4[6]) β”œβ”€ Rz(ΞΈ4[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ 
q_4: |0>─ Ry(ΞΈ1[8]) β”œβ”€ Rz(ΞΈ1[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ2[8]) β”œβ”€ Rz(ΞΈ2[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ3[8]) β”œβ”€ Rz(ΞΈ3[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€β”€ Ry(ΞΈ4[8]) β”œβ”€ Rz(ΞΈ4[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ 
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β” β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β” β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β” β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β” β–‘ 
q_0: |0>─0                                                                   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€0     β”œβ”€β–‘β”€β”€0                                                                   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€0     β”œβ”€β–‘β”€β”€0                                                                   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€0     β”œβ”€β–‘β”€β”€0                                                                   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€0     β”œβ”€β–‘β”€
        β”‚                                                                    β”‚β”Œβ”€β”€β”€β”€β”€β”€β”β”‚      β”‚ β–‘ β”‚                                                                    β”‚β”Œβ”€β”€β”€β”€β”€β”€β”β”‚      β”‚ β–‘ β”‚                                                                    β”‚β”Œβ”€β”€β”€β”€β”€β”€β”β”‚      β”‚ β–‘ β”‚                                                                    β”‚β”Œβ”€β”€β”€β”€β”€β”€β”β”‚      β”‚ β–‘ 
q_1: |0>─1                                                                   β”œβ”€0     β”œβ”€1     β”œβ”€β–‘β”€β”€1                                                                   β”œβ”€0     β”œβ”€1     β”œβ”€β–‘β”€β”€1                                                                   β”œβ”€0     β”œβ”€1     β”œβ”€β–‘β”€β”€1                                                                   β”œβ”€0     β”œβ”€1     β”œβ”€β–‘β”€
        β”‚                                                                    β”‚β”‚      β”‚β”‚  cxs β”‚ β–‘ β”‚                                                                    β”‚β”‚      β”‚β”‚  cxs β”‚ β–‘ β”‚                                                                    β”‚β”‚      β”‚β”‚  cxs β”‚ β–‘ β”‚                                                                    β”‚β”‚      β”‚β”‚  cxs β”‚ β–‘ 
q_2: |0>─2 ryrz(ΞΈ1[0],ΞΈ1[1],ΞΈ1[2],ΞΈ1[3],ΞΈ1[4],ΞΈ1[5],ΞΈ1[6],ΞΈ1[7],ΞΈ1[8],ΞΈ1[9]) β”œβ”€1     β”œβ”€2     β”œβ”€β–‘β”€β”€2 ryrz(ΞΈ2[0],ΞΈ2[1],ΞΈ2[2],ΞΈ2[3],ΞΈ2[4],ΞΈ2[5],ΞΈ2[6],ΞΈ2[7],ΞΈ2[8],ΞΈ2[9]) β”œβ”€1     β”œβ”€2     β”œβ”€β–‘β”€β”€2 ryrz(ΞΈ3[0],ΞΈ3[1],ΞΈ3[2],ΞΈ3[3],ΞΈ3[4],ΞΈ3[5],ΞΈ3[6],ΞΈ3[7],ΞΈ3[8],ΞΈ3[9]) β”œβ”€1     β”œβ”€2     β”œβ”€β–‘β”€β”€2 ryrz(ΞΈ4[0],ΞΈ4[1],ΞΈ4[2],ΞΈ4[3],ΞΈ4[4],ΞΈ4[5],ΞΈ4[6],ΞΈ4[7],ΞΈ4[8],ΞΈ4[9]) β”œβ”€1     β”œβ”€2     β”œβ”€β–‘β”€
        β”‚                                                                    β”‚β”‚  cxs β”‚β”‚      β”‚ β–‘ β”‚                                                                    β”‚β”‚  cxs β”‚β”‚      β”‚ β–‘ β”‚                                                                    β”‚β”‚  cxs β”‚β”‚      β”‚ β–‘ β”‚                                                                    β”‚β”‚  cxs β”‚β”‚      β”‚ β–‘ 
q_3: |0>─3                                                                   β”œβ”€2     β”œβ”€3     β”œβ”€β–‘β”€β”€3                                                                   β”œβ”€2     β”œβ”€3     β”œβ”€β–‘β”€β”€3                                                                   β”œβ”€2     β”œβ”€3     β”œβ”€β–‘β”€β”€3                                                                   β”œβ”€2     β”œβ”€3     β”œβ”€β–‘β”€
        β”‚                                                                    β”‚β”‚      β”‚β””β”€β”€β”€β”€β”€β”€β”˜ β–‘ β”‚                                                                    β”‚β”‚      β”‚β””β”€β”€β”€β”€β”€β”€β”˜ β–‘ β”‚                                                                    β”‚β”‚      β”‚β””β”€β”€β”€β”€β”€β”€β”˜ β–‘ β”‚                                                                    β”‚β”‚      β”‚β””β”€β”€β”€β”€β”€β”€β”˜ β–‘ 
q_4: |0>─4                                                                   β”œβ”€3     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–‘β”€β”€4                                                                   β”œβ”€3     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–‘β”€β”€4                                                                   β”œβ”€3     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–‘β”€β”€4                                                                   β”œβ”€3     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–‘β”€
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”˜         β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”˜         β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”˜         β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”˜         β–‘ 
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–‘ 
q_0: |0>─ U3(ΞΈ1[0],0,0) β”œβ”€ U1(ΞΈ1[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€β”€ U3(ΞΈ2[0],0,0) β”œβ”€ U1(ΞΈ2[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€β”€ U3(ΞΈ3[0],0,0) β”œβ”€ U1(ΞΈ3[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€β”€ U3(ΞΈ4[0],0,0) β”œβ”€ U1(ΞΈ4[1]) β”œβ”€β”€β”€β”€β”€β”€β”€β– β”€β”€β”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”Œβ”€β”΄β”€β” β–‘ 
q_1: |0>─ U3(ΞΈ1[2],0,0) β”œβ”€ U1(ΞΈ1[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ U3(ΞΈ2[2],0,0) β”œβ”€ U1(ΞΈ2[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ U3(ΞΈ3[2],0,0) β”œβ”€ U1(ΞΈ3[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ U3(ΞΈ4[2],0,0) β”œβ”€ U1(ΞΈ4[3]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ 
q_2: |0>─ U3(ΞΈ1[4],0,0) β”œβ”€ U1(ΞΈ1[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€β”€ U3(ΞΈ2[4],0,0) β”œβ”€ U1(ΞΈ2[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€β”€ U3(ΞΈ3[4],0,0) β”œβ”€ U1(ΞΈ3[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€β”€ U3(ΞΈ4[4],0,0) β”œβ”€ U1(ΞΈ4[5]) β”œβ”€ X β”œβ”€β”€β– β”€β”€β”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β” β–‘ 
q_3: |0>─ U3(ΞΈ1[6],0,0) β”œβ”€ U1(ΞΈ1[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ U3(ΞΈ2[6],0,0) β”œβ”€ U1(ΞΈ2[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ U3(ΞΈ3[6],0,0) β”œβ”€ U1(ΞΈ3[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€β”€ U3(ΞΈ4[6],0,0) β”œβ”€ U1(ΞΈ4[7]) β”œβ”€β”€β– β”€β”€β”€ X β”œβ”€β–‘β”€
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”΄β”€β”β””β”€β”€β”€β”˜ β–‘ 
q_4: |0>─ U3(ΞΈ1[8],0,0) β”œβ”€ U1(ΞΈ1[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€β”€ U3(ΞΈ2[8],0,0) β”œβ”€ U1(ΞΈ2[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€β”€ U3(ΞΈ3[8],0,0) β”œβ”€ U1(ΞΈ3[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€β”€ U3(ΞΈ4[8],0,0) β”œβ”€ U1(ΞΈ4[9]) β”œβ”€ X β”œβ”€β”€β”€β”€β”€β”€β–‘β”€
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”˜      β–‘ 
0reactions
dongreenbergcommented, May 9, 2019

I like the array (ΞΈ[n]) notation better, will change to that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Please add support for vector parameters Β· Issue #133
I found a way to work around this by explicitly casting the member elements of the vector to &ToSql type. let sql =...
Read more >
An Idiot's guide to Support vector machines (SVMs)
Basic idea of support vector machines: just like 1- layer or multi-layer neural nets ... β€œcapacity”= # of independent features/parameters ... (We add...
Read more >
Add or Append Element to Vector in R?
How to add or append an element to Vector in R? Use append() function to add a single element or multiple elements to...
Read more >
How to get the support vectors when using LinearSVC?
So, if you don't have performance issues, you can end up with your desired support_vectors_ simply by replacing LinearSVC() with the largelyΒ ...
Read more >
Add Value to the End of a List Parameter
To add a value in the middle of a list, select the value at the desired position of the list and use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found