Skip to content

Fix doctest q fourier transform.py #9943 - #10624

Merged
cclauss merged 5 commits into
TheAlgorithms:masterfrom
Jaivignesh-afk:fix-doctest-q_fourier_transform.py
Sep 13, 2026
Merged

cclauss merged 5 commits into
TheAlgorithms:masterfrom
Jaivignesh-afk:fix-doctest-q_fourier_transform.py

Conversation

@Jaivignesh-afk

Copy link
Copy Markdown
Contributor

Describe your change:

I have corrected failure examples in the doctests and added testmod function to the program
Contributes to #9943

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Contributes to Improve our test coverage #9943 ".

@Jaivignesh-afk

Copy link
Copy Markdown
Contributor Author

I don't know what's wrong here, in my local system I'm getting 91% cover.Can anyone help me out with this?

Comment on lines -93 to -96
print(
f"Total count for quantum fourier transform state is: \
{quantum_fourier_transform(3)}"
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

@Jaivignesh-afk Jaivignesh-afk Oct 17, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got error relating to more no of lines in the pre-commit.So i checked with other algorithms there were no print statements..So,but i can change it back
I think, qiskit module is not yet available for Python 3.12 +
maybe that is the reason?

@cclauss

cclauss commented Oct 17, 2023

Copy link
Copy Markdown
Member

@cclauss cclauss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert pre-commit changes.

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
@algorithms-keeper algorithms-keeper Bot added the awaiting changes A maintainer has requested changes to this PR label Sep 13, 2026
Co-authored-by: Christian Clauss <cclauss@me.com>
@algorithms-keeper algorithms-keeper Bot added merge conflicts Open a new PR or rebase on the latest commit awaiting reviews This PR is ready to be reviewed and removed awaiting changes A maintainer has requested changes to this PR labels Sep 13, 2026
@algorithms-keeper algorithms-keeper Bot removed the merge conflicts Open a new PR or rebase on the latest commit label Sep 13, 2026
Comment thread quantum/q_fourier_transform.py
@github-actions
github-actions Bot force-pushed the fix-doctest-q_fourier_transform.py branch 2 times, most recently from e140b8d to 4bc28d6 Compare September 13, 2026 04:28
Added print statements to display the total count for the quantum Fourier transform state when the module is run directly.
@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Sep 13, 2026
@cclauss
cclauss merged commit 2c88e22 into TheAlgorithms:master Sep 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants