Documentation
¶
Overview ¶
Package shor implements Shor's quantum factoring algorithm.
Given a composite integer N, the algorithm finds a non-trivial factor by using quantum phase estimation to determine the period of modular exponentiation. For small N (suitable for simulation), it builds the full order-finding circuit and extracts factors classically.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// N is the number to factor.
N int
// NumPhaseBits is the precision bits for phase estimation.
// 0 means auto: 2*ceil(log2(N)).
NumPhaseBits int
// Shots is the number of measurement shots. Default: 1024.
Shots int
// MaxAttempts is the maximum number of random base attempts. Default: 10.
MaxAttempts int
}
Config specifies the Shor factoring parameters.
Click to show internal directories.
Click to hide internal directories.