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.

This issue seeks to settle the naming convention for factory functions that produce gate instances given rotation angles. I found the following factories:

Rx, Ry, Rz, GivensRotation, ISwapRotation, MS

These are clearly inconsistent. Proposals:

  1. Rx, Ry, Rz, Rgivens, Riswap, Rms
  2. rx, ry, rz, rgivens, riswap, rms
  3. XRotation, YRotation, ZRotation, GivensRotation, ISwapRotation, MSRotation
  4. x_rotation, y_rotation, z_rotation, givens_rotation, iswap_rotation, ms_rotation

I’m uneasy about conventions that lead to names like cirq.rms since this may be interpreted as “root mean square”.

To broaden the set of examples, here are some names we may reasonably anticipate in future:

Rzz, pauli_string_rotation

Context: comment

Thoughts?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Strilanccommented, Nov 8, 2019

Rx, Ry, Rz, Rgivens, Riswap, Rms

Rms reads like root mean square. Rgivens and Riswap are sorta logical given the first three, but very weird on their own. Violates python naming convention.

rx, ry, rz, rgivens, riswap, rms

rms reads like root mean square. rgivens and riswap are sorta logical given the first three, but very weird on their own. Semi-violates python naming convention in that there would normally be an underscore after the r.

XRotation, YRotation, ZRotation, GivensRotation, ISwapRotation, MSRotation

The names for X/Y/Z are too long IMO. The most common gates should have short names. MSRotation seems wrong; like saying HadamardRotation. I get what it means but it’s odd. Violates python naming convention.

x_rotation, y_rotation, z_rotation, givens_rotation, iswap_rotation, ms_rotation

Too long x/y/z. ms_rotation seems strange.

rx, ry, rz, givens, iswap, ms.

Lacks consistency across them, but honestly I like this one the best by far. Avoiding the rotation word for two qubit operations seems to be a good idea.

The only major problem, I think, is that it will be confusing to have iswap and ISWAP.

0reactions
mpharrigancommented, Nov 14, 2019

ok

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rotations - Varsity Tutors
A rotation is a transformation in a plane that turns every point of a preimage through a specified angle and direction about a...
Read more >
1.7 Rules for Rotations
In geometry, a transformation is an operation that moves, flips, or changes a shape to create a new shape. A rotation is an...
Read more >
Rotations - Google Workspace Marketplace
Rotations enables users to provide a list of names that should be rotated through in naming calendar events.
Read more >
Rotation - MathBitsNotebook(JR)
Rotations may be clockwise (CW) or counterclockwise (CCW). • Naming (lettering) a figure in a translation occurs in the same direction in both...
Read more >
Name Rotation - GeoGebra
Name Rotation. Author: 99007497. Topic: Rotation. GeoGebra Applet Press Enter to start activity. New Resources. Exploring Line Reflections in the Coordinate ...
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