Shor: Shor

Description Usage Arguments Value Examples

View source: R/Shor.R

Description

Implements Shor's algorithm by applying the quantum oracle, performing a QFT, measuring the output, and using continued fractions algorithm to find period. Period is then used with Euclidean algorithm to check if factors are legitimate prime factors. Is probabilistic and may fail. Factors 15 with ease and 21 occassionally.

Usage

1
Shor(N,trials=150,random=FALSE)

Arguments

N

Number that Shor's algorithm is to factor

trials

Number of times to attempt before giving up

random

Boolean which determines whether seed is random or not

Value

Vector containing prime factors

Examples

1
 Shor(15,trials=2)

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.

Related to Shor in QuantumOps...