Skip to content

Can't measure the fidelity of the states. #745

Open
@Shuhul24

Description

@Shuhul24

I have measure the quantum states using tfq.layers.State(). The output of tfq.layers.State() is of the form tf.RaggedTensor. Now I have measured two different states, using the same method. (say state1 and state2)
After using cirq.fidelity(state1, state2), I am getting the following error:

ValueError: Exception encountered when calling layer "generator__discriminator_6" (type Generator_Discriminator).

Failed to infer the qid shape of the given states. Please specify the qid shape explicitly using the `qid_shape` argument.

Call arguments received:
  • inputs=tf.Tensor(shape=(1,), dtype=string)

Why is it so? And how can I measure the fidelity of the states using tfq.layers.State()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/questionFurther information is requestedtriage/insufficient-infoNeeds more information before it can be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions