Back to News
quantum-computing

Definition of lg in IBM quantum learning resources

TonyM
Loading...
2 min read
0 likes
⚡ Quantum Brief
IBM’s quantum learning resources define lg(N-1) as the ceiling of the binary logarithm plus one, diverging from the standard log₂(N-1) convention used elsewhere. This unconventional definition appears in IBM’s Shor’s algorithm materials, specifically to calculate the bit length required to encode N-1, ensuring sufficient qubit allocation for factorization tasks. The notation lg(x) typically denotes log₂(x) in computer science and engineering texts, like Introduction to Algorithms, but its integer vs. real-number interpretation varies by context. IBM’s version explicitly accounts for integer encoding, adding clarity for quantum circuit implementations where exact bit precision matters, unlike floating-point approximations in classical algorithms. No evidence links this definition to broader quantum literature, such as Nielsen & Chuang, suggesting it may be unique to IBM’s educational framework for pedagogical consistency.
AI Audio Summary
0:00 / 0:00
Click to play
Quantum computing technology
Unsplash · Validated Fallback

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work. Bring the best of human thought and AI automation together at your work. Learn more TeamsQ&A for workConnect and share knowledge within a single location that is structured and easy to search.In its discussion of Shor's algorithm IBM's quantum learning platform uses the definition$$ n = \lg(N-1) = \lfloor{\log(N-1)}\rfloor+1 $$to describe the number of bits needed to encode the value N-1.https://quantum.cloud.ibm.com/learning/en/courses/fundamentals-of-quantum-algorithms/phase-estimation-and-factoring/shor-algorithmThis seems to be an unconventional (albeit useful) definition of lg (which generally seems to be defined simply as log_2). I am wondering whether this definition has an origin outside of the IBM learning resources or whether this usage is unique to this resource. I am not seeing it in Nielsen & Chuang, for example. Anybody have any reference for where this notation might originate?It is common (although not standard) is to use $\lg(x)$ to represent $\log_2(x).$ You see this in many engineering/computer science references and in some algorithms textbooks, such as Introduction to Algorithms.What can be unclear is if $\lg(x)$ is supposed to be over binary (integer) numbers (in which case it should follow the definition above), or over the reals. Depending on context, $\lg(x)$ can represent the binary logarithm, for which the definition you are giving above holds.Thanks for contributing an answer to Quantum Computing Stack Exchange!But avoid …Use MathJax to format equations. MathJax reference.To learn more, see our tips on writing great answers.Required, but never shown By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy. Start asking to get answersFind the answer to your question by asking.Explore related questionsSee similar questions with these tags.To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2025.11.20.37056

Read Original

Tags

ibm

Source Information

Source: Quantum Computing Stack Exchange

Discussion

0 professional contributions

Sign in to join this professional discussion.

Be the first to add a constructive contribution.