Skip to content

Improper way of setting up unitary with customized initial value  #7

@Ye2018

Description

@Ye2018

The code

# Set the initial unitary using the result from the previous example.
opts = {"initial_unitary": np.array([[ 1,  1],
                                     [-1, 1]]/np.sqrt(2))}

# Execute and obtain Unitary matrix of the circuit
result = execute(qc_init, simulator, backend_options=opts).result()

doesn't work any more.
We should use:

qc_init.set_unitary( np.array([[1, 1], 
                             [-1, 1]]/np.sqrt(2)))

to set up the initial value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions