Quantics
Documentation for Quantics.
Quantics.ImaginaryTimeFT
Quantics._asdiagonal
Quantics._binaryop_mpo
Quantics._binaryop_tensor
Quantics._directprod
Quantics._qft
Quantics._reverse
Quantics._shift_mpo
Quantics._zero_mpo
Quantics.affinetransform
Quantics.affinetransform
Quantics.affinetransformmpo
Quantics.automul
Quantics.binaryop_tensor_multisite
Quantics.combinesites
Quantics.cumsum
Quantics.decompose_giv
Quantics.expqtt
Quantics.extractdiagonal
Quantics.findallsites_by_tag
Quantics.flipop
Quantics.flipop_to_negativedomain
Quantics.forwardmpo
Quantics.fouriertransform
Quantics.makesitediagonal
Quantics.matchsiteinds
Quantics.onemps
Quantics.phase_rotation
Quantics.phase_rotation_mpo
Quantics.poletomps
Quantics.poletomps
Quantics.reverseaxis
Quantics.shiftaxis
Quantics.shiftaxismpo
Quantics.split_tensor
Quantics.tobin!
Quantics.unfuse_siteinds
Quantics.upper_lower_triangle_matrix
Quantics.ImaginaryTimeFT
— TypeFor imaginary-time/-frequency domains
Quantics._asdiagonal
— MethodConvert an MPS tensor to an MPO tensor with a diagonal structure
Quantics._binaryop_mpo
— MethodConstruct 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
).
Quantics._binaryop_tensor
— Method$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.ImaginaryTimeFT
Quantics._asdiagonal
Quantics._binaryop_mpo
Quantics._binaryop_tensor
Quantics._directprod
Quantics._qft
Quantics._reverse
Quantics._shift_mpo
Quantics._zero_mpo
Quantics.affinetransform
Quantics.affinetransform
Quantics.affinetransformmpo
Quantics.automul
Quantics.binaryop_tensor_multisite
Quantics.combinesites
Quantics.cumsum
Quantics.decompose_giv
Quantics.expqtt
Quantics.extractdiagonal
Quantics.findallsites_by_tag
Quantics.flipop
Quantics.flipop_to_negativedomain
Quantics.forwardmpo
Quantics.fouriertransform
Quantics.makesitediagonal
Quantics.matchsiteinds
Quantics.onemps
Quantics.phase_rotation
Quantics.phase_rotation_mpo
Quantics.poletomps
Quantics.poletomps
Quantics.reverseaxis
Quantics.shiftaxis
Quantics.shiftaxismpo
Quantics.split_tensor
Quantics.tobin!
Quantics.unfuse_siteinds
Quantics.upper_lower_triangle_matrix
Quantics.ImaginaryTimeFT
— TypeFor imaginary-time/-frequency domains
sourceQuantics._asdiagonal
— MethodConvert an MPS tensor to an MPO tensor with a diagonal structure
sourceQuantics._binaryop_mpo
— MethodConstruct 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
).
sourceQuantics._binaryop_tensor
— Method$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).
sourceQuantics._directprod
— MethodConnect two MPS's ITensor objects are deepcopied.
sourceQuantics._qft
— MethodCreate 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)$.
sourceQuantics._reverse
— MethodReverse the order of the MPS/MPO tensors The order of the siteinds are reversed in the returned object.
sourceQuantics._shift_mpo
— MethodFor 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
sourceQuantics._zero_mpo
— MethodCreate a MPO with ITensor objects of ElType ComplexF64 filled with zero
sourceQuantics.affinetransform
— MethodConstruct 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
).
sourceQuantics.affinetransform
— MethodAffine transform of a MPS with no shift Significant bits are assumed to be aligned from left to right for all tags.
sourceQuantics.affinetransformmpo
— MethodGenerate 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.
sourceQuantics.automul
— MethodBy default, elementwise multiplication will be performed.
sourceQuantics.binaryop_tensor_multisite
— MethodCreate a tensor acting on a vector of sites.
sourceQuantics.combinesites
— MethodContract two adjacent tensors in MPO
sourceQuantics.cumsum
— MethodCreate MPO for cumulative sum in QTT
includeown = False yi = sum{j=1}^{i-1} x_j
sourceQuantics.decompose_giv
— Methodw = (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.
sourceQuantics.expqtt
— MethodCreate an MPS representing exp(a*x) on [0, 1) in QTT
exp(-a*x) = prod{n=1}^R exp(a * 2^(-n) * xn)
sourceQuantics.extractdiagonal
— MethodExtract diagonal components
sourceQuantics.findallsites_by_tag
— MethodFind 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.
sourceQuantics.flipop
— MethodThis 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
sourceQuantics.flipop_to_negativedomain
— MethodThis function returns an MPO, M, representing the transformation f(x) = g(-x) where f(x) = M * g(x) for x = 0, 1, ..., 2^R-1.
sourceQuantics.forwardmpo
— Methodsites[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}},\]
sourceQuantics.fouriertransform
— MethodPerform 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
.
sourceQuantics.makesitediagonal
— MethodMakes 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'
.
sourceQuantics.matchsiteinds
— MethodMatch 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.
sourceQuantics.onemps
— MethodCreate a MPS filled with one
sourceQuantics.phase_rotation
— MethodMultiply by exp(i θ x), where x = (x1, ..., xR)_2.
sourceQuantics.phase_rotation_mpo
— MethodCreate an MPO for multiplication by exp(i θ x)
, where x = (x_1, ..., x_R)_2
.
sites
: site indices for x_1
, x_2
, ..., x_R
.
sourceQuantics.poletomps
— MethodConstruct an MPS representing fermionic G(τ) generated by a pole
sourceQuantics.poletomps
— MethodConstruct an MPS representing G(τ) generated by a pole
sourceQuantics.reverseaxis
— Methodf(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.
sourceQuantics.shiftaxis
— Methodf(x) = g(x + shift) for x = 0, 1, ..., 2^R-1 and 0 <= shift < 2^R.
sourceQuantics.shiftaxismpo
— Methodf(x) = g(x + shift) for x = 0, 1, ..., 2^R-1 and 0 <= shift < 2^R.
sourceQuantics.split_tensor
— MethodDecompose the given tensor into as the product of tensors by QR
The externel indices of the results tensors are specified by inds_list
.
sourceQuantics.tobin!
— MethodTo bits
sourceQuantics.unfuse_siteinds
— MethodUn-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.
sourceQuantics.upper_lower_triangle_matrix
— MethodCreate QTT for a upper/lower triangle matrix filled with one except the diagonal line
sourceSettings
This document was generated with Documenter.jl version 1.8.0 on Wednesday 27 November 2024. Using Julia version 1.11.1.
+ 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).
Quantics._directprod
— MethodConnect two MPS's ITensor objects are deepcopied.
Quantics._qft
— MethodCreate 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)$.
Quantics._reverse
— MethodReverse the order of the MPS/MPO tensors The order of the siteinds are reversed in the returned object.
Quantics._shift_mpo
— MethodFor 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
Quantics._zero_mpo
— MethodCreate a MPO with ITensor objects of ElType ComplexF64 filled with zero
Quantics.affinetransform
— MethodConstruct 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
).
Quantics.affinetransform
— MethodAffine transform of a MPS with no shift Significant bits are assumed to be aligned from left to right for all tags.
Quantics.affinetransformmpo
— MethodGenerate 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.
Quantics.automul
— MethodBy default, elementwise multiplication will be performed.
Quantics.binaryop_tensor_multisite
— MethodCreate a tensor acting on a vector of sites.
Quantics.combinesites
— MethodContract two adjacent tensors in MPO
Quantics.cumsum
— MethodCreate MPO for cumulative sum in QTT
includeown = False yi = sum{j=1}^{i-1} x_j
Quantics.decompose_giv
— Methodw = (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.
Quantics.expqtt
— MethodCreate an MPS representing exp(a*x) on [0, 1) in QTT
exp(-a*x) = prod{n=1}^R exp(a * 2^(-n) * xn)
Quantics.extractdiagonal
— MethodExtract diagonal components
Quantics.findallsites_by_tag
— MethodFind 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.
Quantics.flipop
— MethodThis 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
Quantics.flipop_to_negativedomain
— MethodThis function returns an MPO, M, representing the transformation f(x) = g(-x) where f(x) = M * g(x) for x = 0, 1, ..., 2^R-1.
Quantics.forwardmpo
— Methodsites[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}},\]
Quantics.fouriertransform
— MethodPerform 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
.
Quantics.makesitediagonal
— MethodMakes 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'
.
Quantics.matchsiteinds
— MethodMatch 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.
Quantics.onemps
— MethodCreate a MPS filled with one
Quantics.phase_rotation
— MethodMultiply by exp(i θ x), where x = (x1, ..., xR)_2.
Quantics.phase_rotation_mpo
— MethodCreate an MPO for multiplication by exp(i θ x)
, where x = (x_1, ..., x_R)_2
.
sites
: site indices for x_1
, x_2
, ..., x_R
.
Quantics.poletomps
— MethodConstruct an MPS representing fermionic G(τ) generated by a pole
Quantics.poletomps
— MethodConstruct an MPS representing G(τ) generated by a pole
Quantics.reverseaxis
— Methodf(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.
Quantics.shiftaxis
— Methodf(x) = g(x + shift) for x = 0, 1, ..., 2^R-1 and 0 <= shift < 2^R.
Quantics.shiftaxismpo
— Methodf(x) = g(x + shift) for x = 0, 1, ..., 2^R-1 and 0 <= shift < 2^R.
Quantics.split_tensor
— MethodDecompose the given tensor into as the product of tensors by QR
The externel indices of the results tensors are specified by inds_list
.
Quantics.tobin!
— MethodTo bits
Quantics.unfuse_siteinds
— MethodUn-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.
Quantics.upper_lower_triangle_matrix
— MethodCreate QTT for a upper/lower triangle matrix filled with one except the diagonal line