Skip to content

Instantly share code, notes, and snippets.

@davidmerwin
Last active November 24, 2023 07:40
Show Gist options
  • Save davidmerwin/233ff2d9c5b5b750224f84936e2bc5bf to your computer and use it in GitHub Desktop.
Save davidmerwin/233ff2d9c5b5b750224f84936e2bc5bf to your computer and use it in GitHub Desktop.

TypeScript Snippet

Preview:
// Calculating the step size for each iteration
const stepSize = topmostChordPos / circlesPerHalf;

// Loop from topmostChordPos down to 0
for (let i = topmostChordPos; i > 0; i -= stepSize) {
  // Adding current position (positive and negative) to the chordYPositions array
  chordYPositions.push(i);
  chordYPositions.push(-i);
}
Associated Context
Type Code Snippet ( .ts )
Associated Tags cirq
Description 'No Description Provided'
Related Links https://github.com/davidmerwin
http://quantumai.google/cirq
Related People David Merwin, CIRQ
Sensitive Information No Sensitive Information Detected
Shareable Link https://davidmerwin.pieces.cloud/?p=1196469b39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment