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.

Document in cirq.apply_unitary's docstring that it can operate on qudit subspaces

See original GitHub issue

If you have a state tensor defined over qutrits, and you call cirq.apply_unitary targeting this state tensor but give it a qubit gate, apply_unitary will operate on the 01 subspace. This isn’t currently documented but it should be mentioned in the docstring.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
vtomolecommented, May 11, 2020

@aditya-giri That’s right.

0reactions
daxfohlcommented, Jan 23, 2022

@Strilanc @vtomole instead of this would it make sense to add an optional argument to ApplyUnitaryArgs to specify the subspaces to operate on?

Edit: looks like arbitrary subspaces would be impossible to do performantly, but slices should work, and any 2-dimensional subspace can be specified as a slice. Maybe that’s too unintuitive for the value added though.

cc @cduck @dabacon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generalization of quantum gates to qudits #3190 - GitHub
Now that cirq supports qudits, we should generalize our quantum gates where possible/appropriate. Some examples of gates that should work on ...
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