Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZZFeatureMap does not accept layer lists for entanglement kwarg #12432

Closed
nonhermitian opened this issue May 17, 2024 · 1 comment · Fixed by #12767
Closed

ZZFeatureMap does not accept layer lists for entanglement kwarg #12432

nonhermitian opened this issue May 17, 2024 · 1 comment · Fixed by #12767
Assignees
Labels
bug Something isn't working

Comments

@nonhermitian
Copy link
Contributor

Environment

  • Qiskit version: 1.0.2
  • Python version:
  • Operating system:

What is happening?

N = 3
layer1 = [(0,1)]
layer2 = [(1,2)]

qc = ZZFeatureMap(N, reps=1, entanglement=[layer1, layer2])
qc.draw()

CircuitError: 'Number of items in qubits parameter (2) does not match number of qubits in the circuit (1).'

How can we reproduce the issue?

run above

What should happen?

It should work like TwoLocal does.

Any suggestions?

No response

@nonhermitian nonhermitian added the bug Something isn't working label May 17, 2024
@shravanpatel30
Copy link
Contributor

shravanpatel30 commented Jul 1, 2024

Hi @nonhermitian ,

I have been looking into this issue and I think I have a fix for this. Because ZZFeatureMap is a child class of PauliFeatureMap I have added a method get_entangler_map() which overrides the method from NLocal (parent class of PauliFeatureMap) for when an entaglement is manually specified. But if the entaglement is not a List[List(int)] the original get_entangler_map() method from NLocal will be used. Will you be able to look at what I have done and give me some feedback?

Sorry, I started working on this issue even though it is not assigned to me.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants