Skip to content

Update q_fourier_transform.py #11885

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

ridds-io
Copy link

@ridds-io ridds-io commented Oct 8, 2024

Corrections Summary:

  • Docstring cleaned up: More accurate explanation of input/output.
  • Proper indexing in phase gate: The control and target qubits were set correctly (j, i).
  • Removed unnecessary counter decrement.
  • Aer backend fetching: Cleaned up.
  • Error handling improvements: Slight refinement of error messages.
  • Swaps and measurements: Logic is clearer and follows proper QFT construction.

@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 8, 2024
@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Oct 8, 2024
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Oct 8, 2024
ridds-io and others added 2 commits October 28, 2024 09:52
Using List for Accumulation:
Instead of string concatenation within the loop, result.append() is used to create a list, and join is called at the end to concatenate the list into a string. This is more efficient for larger strings.

Removed Unnecessary Parameter n:
Eliminating the n parameter makes the function simpler and ensures consistent ROT13 encryption/decryption.

Refactored Doctest and Assertions:
The doctest examples are consistent with the revised function, ensuring reversibility through dencrypt(dencrypt(s)) == s without additional parameters.
@algorithms-keeper algorithms-keeper bot added tests are failing Do not merge until tests pass and removed tests are failing Do not merge until tests pass labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reviews This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant