Skip to content
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

Improve readability and maintainability of Unitary Checker #2585

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iqbalbhatti49
Copy link

Improve Readability and Maintainability of Unitary Checker

Description

This PR enhances the readability, maintainability, and overall structure of the Unitary Checker code while preserving its core functionality. The following improvements have been made:

  • Added detailed comments to explain key sections of the code.
  • Refactored variable names for better clarity and understanding.
  • Improved formatting and indentation for consistency.
  • Optimized function structures to enhance readability.
  • Enhanced error-handling messages for better debugging and user-friendliness.

These changes improve code maintainability, making it easier for developers to understand and contribute in the future.

Checklist

  • Code compiles without errors.
  • All functionality remains intact after refactoring.
  • Formatting follows project standards.

Looking forward to feedback and suggestions.

- Added detailed comments to enhance code clarity.  
- Improved variable naming for better understanding.  
- Ensured consistent formatting and indentation.  
- Optimized function structures for readability.  

Signed-off-by: Iqbal Bhatti <[email protected]>
Copy link

copy-pr-bot bot commented Feb 5, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@schweitzpgi schweitzpgi requested a review from boschmitt February 5, 2025 21:24
Copy link
Collaborator

@boschmitt boschmitt left a comment

Choose a reason for hiding this comment

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

I see some improvements here but the there is also "noise". Focus the PR on those improvements. Also the formatting changes are not aligned with CUDA-Q's formatting rules.

Comment on lines +55 to +57
if (!checkMod || !inputMod) {
llvm::errs() << "Error parsing input files.\n";
return EXIT_FAILURE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a good check to have.

Comment on lines +84 to +88
if (!inputOp) {
llvm::errs() << "Function " << opName.str() << " not found in input.\n";
exitStatus = EXIT_FAILURE;
continue;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also good, since one might compile this without assertions.

utils/CircuitCheck/CircuitCheck.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants