You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def ShorsAlgorithm(N):
# Step 1: Initialize two auxiliary qubits a and b, such that N = 2^a * 2^b.
# Step 2: Perform a number of iterations of the following two-qubit procedure.
while True:
# Step 2.1: Perform the addition-subtraction method of modular arithmetic to obtain the period r of a^N.
# Step 2.2: Use the discrete logarithm to find a primitive root, g.
# Step 2.3: Apply the Gaussian elimination to obtain a non-singular linear combination of g and N.
# Step 2.4: Calculate the two partial factors, F1 and F2.
# Step 2.5: Apply a binary quadratic form (BQF) reduction to factor N further.
# If the remaining value of N is small, output the factors found.
if is_small(N):
return factorize(N)
The text was updated successfully, but these errors were encountered:
def ShorsAlgorithm(N):
# Step 1: Initialize two auxiliary qubits a and b, such that N = 2^a * 2^b.
# Step 2: Perform a number of iterations of the following two-qubit procedure.
while True:
# Step 2.1: Perform the addition-subtraction method of modular arithmetic to obtain the period r of a^N.
# Step 2.2: Use the discrete logarithm to find a primitive root, g.
# Step 2.3: Apply the Gaussian elimination to obtain a non-singular linear combination of g and N.
# Step 2.4: Calculate the two partial factors, F1 and F2.
# Step 2.5: Apply a binary quadratic form (BQF) reduction to factor N further.
# If the remaining value of N is small, output the factors found.
if is_small(N):
return factorize(N)
The text was updated successfully, but these errors were encountered: