diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 3314452..a8b1a43 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-27T02:21:41","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-27T16:31:28","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index f8f6f40..bc15adf 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,8 +1,8 @@ -Home · Quantics.jl

Quantics

Documentation for Quantics.

Quantics._binaryop_mpoMethod

Construct an MPO representing a selector associated with binary operations.

We describe the functionality for length(coeffs) = 2 (nsitesbop). In this case, site indices are split into a list of chuncks of nsitesbop sites.

Binary operations are applied to each chunck and the direction of carry is forward (revcarrydirec=true) or backward (revcarrydirec=false).

Assumed revcarrydirec = true, we consider a two-variable g(x, y), which is quantized as x = (x1 ... xR)2, y = (y1 ... yR)_2.

We now define a new function by binary operations as f(x, y) = g(a * x + b * y, c * x + d * y), where a, b, c, d = +/- 1, 0, and s1, s1 are arbitrary integers.

The transform from g to f can be represented as an MPO: f(x1, y1, ..., xR, yR) = M(x1, y1, ...; x'1, y'1, ...) f(x'1, y'1, ..., x'R, y'R).

The MPO M acts a selector: The MPO selects values from f to form g.

For revcarrydirec = false, the returned MPO represents f(xR, yR, ..., x1, y1) = M(xR, yR, ...; x'R, y'R, ...) f(x'R, y'R, ..., x'1, y'_1).

bc is a vector of boundary conditions for each arguments of g (not of f).

source
Quantics._binaryop_tensorMethod

$a x + b y$, where $a = 0, \pm 1$ and $b = 0, \pm 1$ ($a + b \neq -2$).

         out
+Home · Quantics.jl

Quantics

Documentation for Quantics.

Quantics._binaryop_mpoMethod

Construct an MPO representing a selector associated with binary operations.

We describe the functionality for length(coeffs) = 2 (nsitesbop). In this case, site indices are split into a list of chuncks of nsitesbop sites.

Binary operations are applied to each chunck and the direction of carry is forward (revcarrydirec=true) or backward (revcarrydirec=false).

Assumed revcarrydirec = true, we consider a two-variable g(x, y), which is quantized as x = (x1 ... xR)2, y = (y1 ... yR)_2.

We now define a new function by binary operations as f(x, y) = g(a * x + b * y, c * x + d * y), where a, b, c, d = +/- 1, 0, and s1, s1 are arbitrary integers.

The transform from g to f can be represented as an MPO: f(x1, y1, ..., xR, yR) = M(x1, y1, ...; x'1, y'1, ...) f(x'1, y'1, ..., x'R, y'R).

The MPO M acts a selector: The MPO selects values from f to form g.

For revcarrydirec = false, the returned MPO represents f(xR, yR, ..., x1, y1) = M(xR, yR, ...; x'R, y'R, ...) f(x'R, y'R, ..., x'1, y'_1).

bc is a vector of boundary conditions for each arguments of g (not of f).

source
Quantics._binaryop_tensorMethod

$a x + b y$, where $a = 0, \pm 1$ and $b = 0, \pm 1$ ($a + b \neq -2$).

         out
           |
        --------
  cin --|  T   |-- cout
        --------
         |    |
-        x    y

$T_{x, y, \mathrm{out}, \mathrm{cin}, \mathrm{cout}} = 1$ if $a x + b y + \mathrm{cin} = \mathrm{cout}$, $=0$ otherwise (out is the output bit).

source
Quantics._qftMethod

Create a MPO for Fourier transform

We define two integers using the binary format: $x = (x_1 x_2 ...., x_N)_2$, $y = (y_1 y_2 ...., y_N)_2$, where the right most digits are the least significant digits.

Our definition of the Fourier transform is

\[ Y(y) = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} X(x) e^{s i \frac{2\pi y x}{N}} = \sum_{x=0}^{N-1} T(y, x) X(x),\]

where we define the transformation matrix $T$ and $s = \pm 1$.

The created MPO can transform an input MPS as follows. We denote the input and output MPS's by $X$ and $Y$, respectively.

  • $X(x_1, ..., x_N) = X_1(x_1) ... X_N (x_N)$,
  • $Y(y_N, ..., y_1) = Y_1(y_N) ... Y_N (y_1)$.
source
Quantics._reverseMethod

Reverse the order of the MPS/MPO tensors The order of the siteinds are reversed in the returned object.

source
Quantics._shift_mpoMethod

For given function g(x) and shift s, construct an MPO representing f(x) = g(x + s). x: 0, ..., 2^R - 1 0 <= s <= 2^R - 1

We assume that left site indices correspond to significant digits

source
Quantics.affinetransformMethod

Construct an MPO representing a selector associated with binary operations.

We describe the functionality for length(coeffs) = 2 (nsitesbop). In this case, site indices are split into a list of chuncks of nsitesbop sites.

Binary operations are applied to each chunck and the direction of carry is forward (revcarrydirec=true) or backward (revcarrydirec=false).

Assumed revcarrydirec = true, we consider a two-variable g(x, y), which is quantized as x = (x1 ... xR)2, y = (y1 ... yR)_2.

We now define a new function by binary operations as f(x, y) = g(a * x + b * y + s1, c * x + d * y + s2), where a, b, c, d = +/- 1, 0, and s1, s1 are arbitrary integers.

bc is a vector of boundary conditions for each arguments of g (not of f).

source
Quantics.affinetransformMethod

Affine transform of a MPS with no shift Significant bits are assumed to be aligned from left to right for all tags.

source
Quantics.affinetransformmpoMethod

Generate an MPO representing an affine transform of a MPS with no shift Significant bits are assumed to be aligned from left to right for all tags.

source
Quantics.cumsumMethod

Create MPO for cumulative sum in QTT

includeown = False yi = sum{j=1}^{i-1} x_j

source
Quantics.decompose_givMethod

w = (w1 w2, ..., wR)2 In the resultant MPS, the site indices are wR, w{R-1}, ..., w_1 from the left to the right.

sites: indices for w1, ..., wR in this order.

source
Quantics.expqttMethod

Create an MPS representing exp(a*x) on [0, 1) in QTT

exp(-a*x) = prod{n=1}^R exp(a * 2^(-n) * xn)

source
Quantics.findallsites_by_tagMethod

Find sites with the given tag

For tag = x, if sites contains an Index object with x, the function returns a vector containing only its positon.

If not, the function seach for all Index objects with tags x=1, x=2, ..., and return their positions.

If no Index object is found, an empty vector will be returned.

source
Quantics.flipopMethod

This function returns an MPO, M, representing the transformation f(x) = g(2^R-x) where f(x) = M * g(x) for x = 0, 1, ..., 2^R-1.

sites: the sites of the output MPS

source
Quantics.forwardmpoMethod

sites[1] corresponds to the most significant digit. sign = 1

\[ Y(y) = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} X(x) e^{s i \frac{2\pi (y + y0) (x + x0)}{N}},\]

source
Quantics.fouriertransformMethod

Perform Fourier transform for a subset of qubit indices.

We define two integers using the binary format: $x = (x_1 x_2 ...., x_R)_2$, $y = (y_1 y_2 ...., y_R)_2$, where the right most digits are the least significant digits.

The variable x is denoted as src (source), and the variable y is denoted as dst (destination).

Our definition of the Fourier transform is

\[ Y(y) = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} X(x) e^{s i \frac{2\pi (y + y_0) (x + x_0)}{N}}\]

where $s = \pm 1$, $x_0$ and $y_0$ are constants, $N=2^R$.

sitessrc[1] / sitessrc[end] corresponds to the most/least significant digit of the input. sitesdst[1] / sitesdst[end] corresponds to the most/least significant digit of the output.

siteinds(M) must contain sitessrc in ascending or descending order. Instead of specifying sitessrc, one can specify the source sites by setting tag. If tag = x, all sites with tags x=1, x=2, ... are used as sitessrc.

source
Quantics.makesitediagonalMethod

Makes an MPS/MPO diagonal for a specified a site index s. On return, the data will be deep copied and the target core tensor will be diagonalized with an additional site index s'.

source
Quantics.matchsiteindsMethod

Match MPS/MPO to the given site indices

MPS: The resultant MPS do not depends on the missing site indices.

MPO: For missing site indices, identity operators are inserted.

source
Quantics.reverseaxisMethod

f(x) = g(N - x) = M * g(x) for x = 0, 1, ..., N-1, where x = 0, 1, ..., N-1 and N = 2^R.

Note that x = 0, 1, 2, ..., N-1 are mapped to x = 0, N-1, N-2, ..., 1 mod N.

source
Quantics.split_tensorMethod

Decompose the given tensor into as the product of tensors by QR

The externel indices of the results tensors are specified by inds_list.

source
Quantics.unfuse_siteindsMethod

Un-fuse the site indices of an MPS at the given sites

M: Input MPS where each tensor has only one site index targetsites: Vector of siteinds to be split newsites: Vector of vectors of new siteinds

When splitting MPS tensors, the column major is assumed.

source
+ x y

$T_{x, y, \mathrm{out}, \mathrm{cin}, \mathrm{cout}} = 1$ if $a x + b y + \mathrm{cin} = \mathrm{cout}$, $=0$ otherwise (out is the output bit).

source
Quantics._qftMethod

Create a MPO for Fourier transform

We define two integers using the binary format: $x = (x_1 x_2 ...., x_N)_2$, $y = (y_1 y_2 ...., y_N)_2$, where the right most digits are the least significant digits.

Our definition of the Fourier transform is

\[ Y(y) = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} X(x) e^{s i \frac{2\pi y x}{N}} = \sum_{x=0}^{N-1} T(y, x) X(x),\]

where we define the transformation matrix $T$ and $s = \pm 1$.

The created MPO can transform an input MPS as follows. We denote the input and output MPS's by $X$ and $Y$, respectively.

  • $X(x_1, ..., x_N) = X_1(x_1) ... X_N (x_N)$,
  • $Y(y_N, ..., y_1) = Y_1(y_N) ... Y_N (y_1)$.
source
Quantics._reverseMethod

Reverse the order of the MPS/MPO tensors The order of the siteinds are reversed in the returned object.

source
Quantics._shift_mpoMethod

For given function g(x) and shift s, construct an MPO representing f(x) = g(x + s). x: 0, ..., 2^R - 1 0 <= s <= 2^R - 1

We assume that left site indices correspond to significant digits

source
Quantics.affinetransformMethod

Construct an MPO representing a selector associated with binary operations.

We describe the functionality for length(coeffs) = 2 (nsitesbop). In this case, site indices are split into a list of chuncks of nsitesbop sites.

Binary operations are applied to each chunck and the direction of carry is forward (revcarrydirec=true) or backward (revcarrydirec=false).

Assumed revcarrydirec = true, we consider a two-variable g(x, y), which is quantized as x = (x1 ... xR)2, y = (y1 ... yR)_2.

We now define a new function by binary operations as f(x, y) = g(a * x + b * y + s1, c * x + d * y + s2), where a, b, c, d = +/- 1, 0, and s1, s1 are arbitrary integers.

bc is a vector of boundary conditions for each arguments of g (not of f).

source
Quantics.affinetransformMethod

Affine transform of a MPS with no shift Significant bits are assumed to be aligned from left to right for all tags.

source
Quantics.affinetransformmpoMethod

Generate an MPO representing an affine transform of a MPS with no shift Significant bits are assumed to be aligned from left to right for all tags.

source
Quantics.cumsumMethod

Create MPO for cumulative sum in QTT

includeown = False yi = sum{j=1}^{i-1} x_j

source
Quantics.decompose_givMethod

w = (w1 w2, ..., wR)2 In the resultant MPS, the site indices are wR, w{R-1}, ..., w_1 from the left to the right.

sites: indices for w1, ..., wR in this order.

source
Quantics.expqttMethod

Create an MPS representing exp(a*x) on [0, 1) in QTT

exp(-a*x) = prod{n=1}^R exp(a * 2^(-n) * xn)

source
Quantics.findallsites_by_tagMethod

Find sites with the given tag

For tag = x, if sites contains an Index object with x, the function returns a vector containing only its positon.

If not, the function seach for all Index objects with tags x=1, x=2, ..., and return their positions.

If no Index object is found, an empty vector will be returned.

source
Quantics.flipopMethod

This function returns an MPO, M, representing the transformation f(x) = g(2^R-x) where f(x) = M * g(x) for x = 0, 1, ..., 2^R-1.

sites: the sites of the output MPS

source
Quantics.forwardmpoMethod

sites[1] corresponds to the most significant digit. sign = 1

\[ Y(y) = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} X(x) e^{s i \frac{2\pi (y + y0) (x + x0)}{N}},\]

source
Quantics.fouriertransformMethod

Perform Fourier transform for a subset of qubit indices.

We define two integers using the binary format: $x = (x_1 x_2 ...., x_R)_2$, $y = (y_1 y_2 ...., y_R)_2$, where the right most digits are the least significant digits.

The variable x is denoted as src (source), and the variable y is denoted as dst (destination).

Our definition of the Fourier transform is

\[ Y(y) = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} X(x) e^{s i \frac{2\pi (y + y_0) (x + x_0)}{N}}\]

where $s = \pm 1$, $x_0$ and $y_0$ are constants, $N=2^R$.

sitessrc[1] / sitessrc[end] corresponds to the most/least significant digit of the input. sitesdst[1] / sitesdst[end] corresponds to the most/least significant digit of the output.

siteinds(M) must contain sitessrc in ascending or descending order. Instead of specifying sitessrc, one can specify the source sites by setting tag. If tag = x, all sites with tags x=1, x=2, ... are used as sitessrc.

source
Quantics.makesitediagonalMethod

Makes an MPS/MPO diagonal for a specified a site index s. On return, the data will be deep copied and the target core tensor will be diagonalized with an additional site index s'.

source
Quantics.matchsiteindsMethod

Match MPS/MPO to the given site indices

MPS: The resultant MPS do not depends on the missing site indices.

MPO: For missing site indices, identity operators are inserted.

source
Quantics.reverseaxisMethod

f(x) = g(N - x) = M * g(x) for x = 0, 1, ..., N-1, where x = 0, 1, ..., N-1 and N = 2^R.

Note that x = 0, 1, 2, ..., N-1 are mapped to x = 0, N-1, N-2, ..., 1 mod N.

source
Quantics.split_tensorMethod

Decompose the given tensor into as the product of tensors by QR

The externel indices of the results tensors are specified by inds_list.

source
Quantics.unfuse_siteindsMethod

Un-fuse the site indices of an MPS at the given sites

M: Input MPS where each tensor has only one site index targetsites: Vector of siteinds to be split newsites: Vector of vectors of new siteinds

When splitting MPS tensors, the column major is assumed.

source