Closed umer066 closed 3 months ago
Thanks @umer066 for the issue!
Regarding the variable names - I agree in general. I wanted to keep the g
\ x
names to be as in the description of the algorithm, however it can be changed to g_generator
, x_logarithm
, N_modulus
for clarity.
Regarding the ceil
, log
- they are imported from classiq
because they are used symbolically in the qmod. You can see the resulting discrete_log.qmod
file to better understand.
Hi @orsa-classiq Hope you are doing well.
Thanks for the response. Ok. I will check the resulting discrete_log.qmod
file to better understand.
I appreciate your understanding and flexibility. To maintain clarity and consistency in the codebase, I suggest making the following adjustments:
Keep the variable names g, x
, and N
as per the algorithm's description, but append more descriptive names like g_generator
, x_logarithm
, and N_modulus
where needed. This will enhance readability without deviating from the algorithm's conventions.
After making these adjustments, we'll thoroughly review the code to ensure it aligns with the algorithm's description, maintains clarity, and seamlessly integrates with the library. Extensive testing will be conducted to identify any potential issues or unexpected behavior and ensure the code's reliability.
These changes will improve the code's maintainability and readability while preserving its functionality within the qmod environment. Your approval to proceed with these adjustments would be greatly appreciated.
Looking forward to your feedback!
Best regards,
Nice, you are welcome to proceed
Description Optimize the implementation of the code. The suggested changes includes better variable naming, type annotations and code structure improvements
Type of change Please delete options that are not relevant.
We can import all at once instead of importing multiple times
from math import ceil, log
We can also use ceiling and log from math
We can maintain consistency by using variable names like these
We can improve the functions for better code readability like this.