text:
Number of n-th roots of unity over finite fields [closed]

How many $n$-th roots of unity does a finite field $\mathbb{GF}\left(p^k\right)$ have? ($p$ is prime). And then kind of related to that, is there a finite field with exactly $n_1,\ldots,n_N$ $n_1$-th,...$n_N$-th roots of unity?

-

closed as too localized by Felipe Voloch, J.C. Ottem, Ben Webster♦Mar 13 '11 at 23:30

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

The group of nonzero elements is cyclic of order p^k-1, so your question is the same as: in a cyclic group of order N (=p^k-1), how many solutions are there to the equation x^n = 1? This is enough of a hint. Now review your knowledge of cyclic groups. – KConrad Mar 13 '11 at 20:02
Anadim- MO is intended for questions of a research level. Thus, questions which are covered in standard undergraduate courses (in this case, Galois theory) are a better fit for math.stackexchange.com – Ben Webster Mar 13 '11 at 23:32
thank you all. It didn't seem to me that it was undegrad level, so I thought I'd go for MO. I 'll be more careful next time :). – Anadim Mar 14 '11 at 0:10

I can quickly answer your first question. The multiplicative group of $\mathbb{GF}(p^k)$ is cyclic, let $g$ be a generator. For an element $x$ of the group $x^n=1$ holds iff $x=g^m$ with $nm$ divisible by $p^k-1$. The latter is equivalent to $m$ divisible by $(p^k-1)/d$, where $d:=\gcd(n,p^k-1)$, hence the $n$-th roots of unity form the subgroup generated by $g^{(p^k-1)/d}$. This subgroup clearly has $d$ elements, so the number of $n$-th roots equals $\gcd(n,p^k-1)$.
EDIT: The second question is also easy. It is clearly necessary that the $n_i$'s be coprime with $p$. If this condition holds, then there is a $k>0$ such that $p^k-1$ is divisible by each of the $n_i$'s, and such a $k$ will do by the above (while no other $k$ will do).


text:
Simple FASTQ/A manipulation... how to add a single adapter sequence to 5' of all reads?
2
0
Entering edit mode
3.7 years ago
quickquark • 0

Hi everyone, and thanks in advance! I'm used to doing lots of trimming, substituting, etc on large FASTQ/A files, but now I need to add sequence arbitrarily at the beginning of all reads and I'm coming up short! Been searching a couple hours for a method via toolkit (fastx_toolkit, BBmap, etc.) or simple command (sed, awk, etc.).

So I'm looking to go from something like this:

>header
GTCTCAGATCGGAAGAGCACACGT
CCGGTCCTGGTTGCAGATCGGAAG
GTATCTCCTAAGATATAACAGGTTG
AGGTACAGGTTGGATGATAAGTCC

to this:

>header
AAAAAAGTCTCAGATCGGAAGAGCACACGT
AAAAAACCGGTCCTGGTTGCAGATCGGAAG
AAAAAAGTATCTCCTAAGATATAACAGGTTG
AAAAAAAGGTACAGGTTGGATGATAAGTCC

Alternatively, I can do the same with FASTQ files (also extending the quality lines to match), if there's already a tool out there for that. I'm not interested at quality at this point, as I've already merged paired-end reads with PandaSeq and filtered out anything but the highest quality reads.

FASTA FASTQ • 1.8k views
0
Entering edit mode

While you have been given possible solutions below, you would be breaking fastq format if you do not add corresponding scores on the quality line. Example you showed above is neither valid fasta or fastq format.

0
Entering edit mode

Ah yes, sorry, I should have been more accurate with that in case others come across this. I'll edit it to look like a real FASTA.

1
Entering edit mode

quickquark : Please test @Pierre's solution. It should work and if it does you should accept that too. You can accept more than one answer if they work.

3
Entering edit mode
3.7 years ago

sed will do that:

$sed 's|^[^@>]$$.*$$|AAAAAA\1|g' fastq.fq @header AAAAAATCTCAGATCGGAAGAGCACACGT @header AAAAAACGGTCCTGGTTGCAGATCGGAAG @header AAAAAATATCTCCTAAGATATAACAGGTTG @header AAAAAAGGTACAGGTTGGATGATAAGTCC$ sed 's|^[^@>]$$.*$$|AAAAAA\1|g' fasta.fa
AAAAAATCTCAGATCGGAAGAGCACACGT
AAAAAACGGTCCTGGTTGCAGATCGGAAG
AAAAAATATCTCCTAAGATATAACAGGTTG
AAAAAAGGTACAGGTTGGATGATAAGTCC

The first part between separators (|^[^@>]$$.*$$|) means match anything that does not start with @ or >, and capture the rest of the line in a group (parenthesis). The second part is the replacement, which means replace with AAAAAA followed by group 1 which was captured by the parenthesis.

Update: Added > to the non-matching character class part so it also works for FASTA files as well. See also comment below about FASTQ and multi-line FASTA files.

1
Entering edit mode

manuel.belmadani : You should update your solution to reflect the change OP made to the original question when you have a chance.

0
Entering edit mode

I added the > in the character class. Just be careful that your FASTA files don't have reads over multiple lines, or it'll break (and add AAAAAA at each non-header begining of line, even if multiple lines are part of the same contiguous reads.) This use case is a bit more complicated than the provided input in the original question. Same thing if you have a complete FASTQ file (e.g. with the quality score); then you'd have to avoid editing the quality header and the quality line. Something like what Pierre suggested would work to only edit every 2nd line: sed '2~4 s/^/AAAAAAA/' fastq.fq

2
Entering edit mode
3.7 years ago
sed '2~2 s/^/AAAAAAA/' input.txt

format: plain


text:
# Forever Sine

Geometry Level 3

$\sin^2 \theta + \sin \theta = 1$

Given the above equation, state the expression below in terms of $$\theta$$

$\sin^{6} \theta + \sin^{5} \theta + \sin^{4} \theta + \sin^{3} \theta + \sin^{2} \theta + \sin \theta$

×


text:
# Use continuity to show that $f(x)=x^3$ is uniformly continuous on $[0,1]$ but not $[0,\infty]$

I'm trying to use continuity to show that $f(x)=x^3$ is uniformly continuous on $[0,1]$ but not $[0,\infty)$.

I've tried setting up an epsilon-delta proof, but I'm struggling a little:

By definition of uniform continuity, we know that $\forall \epsilon >0, \exists \delta >0$ such that

$|x-y|<\delta \Rightarrow |f(x) - f(y)| < \epsilon$.

And so, forcing

$\delta = \min\{1, \frac{\epsilon}{p_x}\}$ where $p_x = (x^2+xy+y^2)$

And so, we havve that

$|(x)^3 - (y)^3|=|(x-y)(x^2+xy+y^2)| < |\delta (x^2 + xy+y^2)| < \epsilon$

I'm not sure if this is the correct way to go about proving it, or if I landed myself into a circular argument. Furthermore, intuitively I'm guessing we only have uniform continuity on $[0,1]$ but not [0,$\infty)$ because our $p_x$ would get too large?

– user399481
Dec 19, 2016 at 1:36
• Note that in general, ANY continuous function on a compact set is uniformly continuous. Dec 19, 2016 at 1:36
• @AlexR. Ah yes. And we have compactness because we have a closed set (by the Heine Borel theorem)? Dec 19, 2016 at 1:45
• @Nikitau $[0,1]$ is closed and bounded and hence compact by Heine Borel. Dec 19, 2016 at 2:42

Note that in the definition of uniform continuity, given $\varepsilon > 0$, you need to provide a $\delta > 0$ that works for all $x,y \in [0,1]$. In particular, you cannot have a $\delta$ that depends on $x$. This is in contrast to proving that $f$ is continuous at a specific $x$ where the $\delta$ you provide can depend on $x$.

$$|x^3 - y^3| = |(x - y)(x^2 + xy + y^2)| \leq |x - y||x^2 + xy + y^2|.$$

Now, if $x,y \in [0,1]$, we have $|x^2 + xy + y^2| \leq 3$ so we can deduce that

$$|x^3 - y^3| \leq 3|x - y|.$$

Hence, given $\varepsilon > 0$, we can take $\delta = \frac{\varepsilon}{3}$ and then if $|x - y| < \delta$ then $|x^3 - y^3| \leq 3|x - y| < 3\delta = \varepsilon$.

Note that the same argument would work if you wanted to prove uniform continuity on $[0,L]$ with the constant $3$ replaced by a different constant $C_L$ which bounds $|x^2 + xy + y^2|$ on $[0,L]$ (for example, $C_L$ can be $3L^2$).

Expressed in this way, we see that your basic intuition is correct. As $L$ gets larger, our constant $C_L$ also gets larger and hence our $\delta = \frac{\varepsilon}{C_L}$ gets smaller and smaller. In the limit, this should lead us to suspect (but this is not a formal proof!) that uniform continuity will fail.

• I'm a little confused on the part where you say that "this is in contrast to proving that f is continuous at a specific x". In an example provided in class, the professor wanted to show $f(x) = \frac{x^3}{1+x^2}$ was continuous on $\mathbb{R}$. She then fixed $x_0 \in \mathbb{R}$, and the delta included a function $P(x_0)$. This is might be a fairly silly question, but I'm confused why we were allowed do to that for the whole of $\mathbb{R}$ but not an interval [0,1]? Dec 19, 2016 at 1:49
• @Nikitau: You are allowed to do it on an interval or on the whole of $\mathbb{R}$, but this only proves that your function is continuous, not uniformly continuous. Being uniformly continuous is a stronger property. If you look at the definition, this is expressed precisely by the fact that to show uniform continuity over some domain $D$, you need to provide a $\delta$ that works for all points in $D$ simultaneously. This is in contrast to proving that $f$ is continuous on $D$ where you can fix a point $x_0 \in D$ and then provide a $\delta = \delta(x_0)$ that depends on $x_0$. Dec 19, 2016 at 1:52
• Oh thanks for the clarification! So if I was just proving continuity, the original post would have been OK? Or would having 'y' in my delta pose a problem? (Sorry for all the questions! I have an exam coming up and I just want to make sure I'm understanding all the nuances). Dec 19, 2016 at 1:56
• @Nikitau: That is a problem. Even if you are only interested in regular continuity at a point $x_0$, you cannot have your $\delta$ depend on the argument of the function, only on $x_0$ (and $\varepsilon$). Dec 19, 2016 at 1:58
• Ah, that makes sense. Thank you for pointing that out :) Dec 19, 2016 at 2:04

To show that $$x^3$$ fails to be uniformly continuous on $$[0,\infty)$$, we take $$\epsilon=\frac{3}{2}$$. Then, for all $$\delta>0$$, and for $$x=\frac{1}{\sqrt\delta}$$ and $$y=\frac{1}{\sqrt \delta}+\frac{\delta}{2}$$ we have $$|x-y|<\delta$$ and

\begin{align}|x^3-y^3|&=\left|\left(\frac{1}{\sqrt\delta}+\frac{\delta}{2}\right)^3-\left(\frac{1}{\sqrt\delta}\right)^3\right|\\\\ &\ge \frac32\\\\ &=\epsilon \end{align}

• I can see why this works, but how does one know what values to set for $\epsilon$ and x,y? Dec 19, 2016 at 2:38
• You need only find one such $\epsilon>0$ such that for any $\delta>0$ there are points $x$ and $y$ such that $|x-y|<\delta$ and $|x^3-y^3|\ge \epsilon$. Certainly, any $\epsilon$ smaller than $3/2$ would have worked also. Dec 19, 2016 at 2:40


text:
# American Institute of Mathematical Sciences

April  2005, 13(1): 63-102. doi: 10.3934/dcds.2005.13.63

## Renormalization of isoenergetically degenerate hamiltonian flows and associated bifurcations of invariant tori

 1 Department of Mathematics, University of Toronto, Toronto, Ontario, Canada M5S 3G3, Canada

Received  December 2003 Revised  December 2004 Published  March 2005

The paper presents a study of a renormalization group transformation acting on an appropriate space of Hamiltonian functions in two angle and two action variables. In particular, we study the existence of real invariant tori, on which the flow is conjugate to a rotation with a rotation number equal to a quadratic irrational ($\omega$-tori). We demonstrate that the stable manifold of the renormalization operator at the "simple" fixed point contains isoenergetically degenerate Hamiltonians possessing shearless $\omega$-tori. We also show that one-parameter families of Hamiltonians transverse to the stable manifold undergo a bifurcation: for a certain range of the parameter values the members of these families posses two distinct $\omega$-tori, the members of such families lying on the stable manifold posses one shearless $\omega$-torus, while the members corresponding to other parameter values do not posses any.
Citation: Denis G. Gaidashev. Renormalization of isoenergetically degenerate hamiltonian flows and associated bifurcations of invariant tori. Discrete & Continuous Dynamical Systems - A, 2005, 13 (1) : 63-102. doi: 10.3934/dcds.2005.13.63
 [1] Hans Koch. On the renormalization of Hamiltonian flows, and critical invariant tori. Discrete & Continuous Dynamical Systems - A, 2002, 8 (3) : 633-646. doi: 10.3934/dcds.2002.8.633 [2] C. Chandre. Renormalization for cubic frequency invariant tori in Hamiltonian systems with two degrees of freedom. Discrete & Continuous Dynamical Systems - B, 2002, 2 (3) : 457-465. doi: 10.3934/dcdsb.2002.2.457 [3] Hans Koch. A renormalization group fixed point associated with the breakup of golden invariant tori. Discrete & Continuous Dynamical Systems - A, 2004, 11 (4) : 881-909. doi: 10.3934/dcds.2004.11.881 [4] Fuzhong Cong, Yong Li. Invariant hyperbolic tori for Hamiltonian systems with degeneracy. Discrete & Continuous Dynamical Systems - A, 1997, 3 (3) : 371-382. doi: 10.3934/dcds.1997.3.371 [5] Shengqing Hu, Bin Liu. Degenerate lower dimensional invariant tori in reversible system. Discrete & Continuous Dynamical Systems - A, 2018, 38 (8) : 3735-3763. doi: 10.3934/dcds.2018162 [6] Tingting Zhang, Àngel Jorba, Jianguo Si. Weakly hyperbolic invariant tori for two dimensional quasiperiodically forced maps in a degenerate case. Discrete & Continuous Dynamical Systems - A, 2016, 36 (11) : 6599-6622. doi: 10.3934/dcds.2016086 [7] João Lopes Dias. Brjuno condition and renormalization for Poincaré flows. Discrete & Continuous Dynamical Systems - A, 2006, 15 (2) : 641-656. doi: 10.3934/dcds.2006.15.641 [8] Sze-Bi Hsu, Bernold Fiedler, Hsiu-Hau Lin. Classification of potential flows under renormalization group transformation. Discrete & Continuous Dynamical Systems - B, 2016, 21 (2) : 437-446. doi: 10.3934/dcdsb.2016.21.437 [9] Hans Koch, João Lopes Dias. Renormalization of diophantine skew flows, with applications to the reducibility problem. Discrete & Continuous Dynamical Systems - A, 2008, 21 (2) : 477-500. doi: 10.3934/dcds.2008.21.477 [10] Hsuan-Wen Su. Finding invariant tori with Poincare's map. Communications on Pure & Applied Analysis, 2008, 7 (2) : 433-443. doi: 10.3934/cpaa.2008.7.433 [11] Ugo Locatelli, Antonio Giorgilli. Invariant tori in the Sun--Jupiter--Saturn system. Discrete & Continuous Dynamical Systems - B, 2007, 7 (2) : 377-398. doi: 10.3934/dcdsb.2007.7.377 [12] Xiaocai Wang. Non-floquet invariant tori in reversible systems. Discrete & Continuous Dynamical Systems - A, 2018, 38 (7) : 3439-3457. doi: 10.3934/dcds.2018147 [13] Martin Pinsonnault. Maximal compact tori in the Hamiltonian group of 4-dimensional symplectic manifolds. Journal of Modern Dynamics, 2008, 2 (3) : 431-455. doi: 10.3934/jmd.2008.2.431 [14] Dmitriy Yu. Volkov. The Hopf -- Hopf bifurcation with 2:1 resonance: Periodic solutions and invariant tori. Conference Publications, 2015, 2015 (special) : 1098-1104. doi: 10.3934/proc.2015.1098 [15] Boris Kalinin, Anatole Katok. Measure rigidity beyond uniform hyperbolicity: invariant measures for cartan actions on tori. Journal of Modern Dynamics, 2007, 1 (1) : 123-146. doi: 10.3934/jmd.2007.1.123 [16] Gemma Huguet, Rafael de la Llave, Yannick Sire. Computation of whiskered invariant tori and their associated manifolds: New fast algorithms. Discrete & Continuous Dynamical Systems - A, 2012, 32 (4) : 1309-1353. doi: 10.3934/dcds.2012.32.1309 [17] Hans Koch, Héctor E. Lomelí. On Hamiltonian flows whose orbits are straight lines. Discrete & Continuous Dynamical Systems - A, 2014, 34 (5) : 2091-2104. doi: 10.3934/dcds.2014.34.2091 [18] Oliver Butterley, Carlangelo Liverani. Robustly invariant sets in fiber contracting bundle flows. Journal of Modern Dynamics, 2013, 7 (2) : 255-267. doi: 10.3934/jmd.2013.7.255 [19] Livio Flaminio, Giovanni Forni, Federico Rodriguez Hertz. Invariant distributions for homogeneous flows and affine transformations. Journal of Modern Dynamics, 2016, 10: 33-79. doi: 10.3934/jmd.2016.10.33 [20] Amadeu Delshams, Pere Gutiérrez, Tere M. Seara. Exponentially small splitting for whiskered tori in Hamiltonian systems: flow-box coordinates and upper bounds. Discrete & Continuous Dynamical Systems - A, 2004, 11 (4) : 785-826. doi: 10.3934/dcds.2004.11.785

2018 Impact Factor: 1.143


text:
×
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 5.1 - Problem 83e
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 5.1 - Problem 83e

×

# Use the principle of mathematical induction to show that

ISBN: 9780073383095 37

## Solution for problem 83E Chapter 5.1

Discrete Mathematics and Its Applications | 7th Edition

• Textbook Solutions
• 2901 Step-by-step solutions solved by professors and subject experts
• Get 24/7 help from StudySoup virtual teaching assistants

Discrete Mathematics and Its Applications | 7th Edition

4 5 1 313 Reviews
17
0
Problem 83E

Problem 83E

Use the principle of mathematical induction to show that P(n) is true for n = b, b + 1, b + 2,…, where b is an integer, if P(b) is true and the conditional statement P(k) → P(k + 1) is true for all integers k with k ≥ b.

Step-by-Step Solution:

Step 1 of 3

The principle of mathematical induction proves a statement by the following two steps.

1. Basis step

2. Inductive step.

Basis step: This step proves that the statement is true for the basic value.

Inductive step: This includes the assumption of the inductive hypothesis and its proof.

We have to prove if P(b) is true, and the conditional statement P (k) ? P (k + 1) is true, then P(n) is true for n=b,b+1,b+2... .

Step 2 of 3

Step 3 of 3

## Discover and learn what students are asking

Calculus: Early Transcendental Functions : Functions of Several Variables
?In Exercises 15 - 22, find all first partial derivatives. $$f(x, y)=4 x^{2}-2 x y+y^{2}$$

Statistics: Informed Decisions Using Data : Applications of the Normal Distribution
?In Problems 19–22, find the value of ?? ?0.01

#### Related chapters

Unlock Textbook Solution


text:
# Work Place Products Inc., a wholesaler of office products, was organized on July 1 of the...

###### Question:

Work Place Products Inc., a wholesaler of office products, was organized on July 1 of the current year, with an authorization of 100,000 shares of 4% preferred stock, $75 par and 500,000 shares of$25 par common stock. The following selected transactions were completed during the first year of operations:

Journalize the transactions.

July. 1. Issued 150,000 shares of common stock at par for cash.

 July. 1

July. 1 Issued 350 shares of common stock at par to an attorney in payment of legal fees for organizing the corporation.

 July. 1

Aug. 7. Issued 19,000 shares of common stock in exchange for land, buildings, and equipment with fair market prices of $89,000,$486,000, and $109,000, respectively. For a compound transaction, if an amount box does not require an entry, leave it blank.  Aug. 7 Sept. 20. Issued 25,000 shares of preferred stock at$87 for cash.

For a compound transaction, if an amount box does not require an entry, leave it blank.

 Sept. 20

#### Similar Solved Questions

##### Despite large concentrations of CO 2 released by human activity, atmospheric CO 2 is not as...
Despite large concentrations of CO 2 released by human activity, atmospheric CO 2 is not as high as some would expect. Studies suggest the reason for this is A addition of new carbon sinks, such as large scale agricultural fields. B increased evapotranspiration activity by phytoplankton. ...
##### Required information [The following information applies to the questions displayed below.] Hemming Co. reported the following...
Required information [The following information applies to the questions displayed below.] Hemming Co. reported the following current-year purchases and sales for its only product. Date Activities Units Acquired at Cost Units Sold at Retail Jan. 1 Beginning inventory 220 units @ $10.80 =$ 2,376 Jan...
##### Calculate the hva hydronium ion. the hydroxide ion concentration in a intration in an aqueous solution...
Calculate the hva hydronium ion. the hydroxide ion concentration in a intration in an aqueous solution that contains 3.50 x 10-3 Min A) 2.86 x 10-12 M B) 2.86 x 10-4 M 20) At what pH is the A) 9.60 what pH is the amino acid glycine with a Ka of 2.51 x 10-10 sixty-six (66%) percent di B) 10.10 C) 10....
##### In preparation for a PET scan, a 75 kg patient is injected with fludeoxyglucose, a special type of glucose containing ra...
In preparation for a PET scan, a 75 kg patient is injected with fludeoxyglucose, a special type of glucose containing radioactive Fluorine-18 (18F). The injected solution contains 2.6 mCi of 18F, which has a half life of 109.8 minutes. Each radioactive particle has a mean energy of 249.8 keV, 90% of...
Barrison is investigating the possible acquisition of Soulmaster. The two firms have the following basic data: Barrison Soulmaster Number of shares 3,000,000 1,200,000 Current stock price $75.00$25.00 The combined firm will result in a synergy gains of $15m. a. What is the value of of the combined ... 2 answers ##### How do you solve t^ { 8} u ^ { 19} v ^ { 6} \cdot t ^ { 37} u v ^ { 0} \cdot t ^ { 8} u v ^ { 0}? How do you solve t^ { 8} u ^ { 19} v ^ { 6} \cdot t ^ { 37} u v ^ { 0} \cdot t ^ { 8} u v ^ { 0}?... 1 answer ##### Question: Use mesh analysis to calculate the following currents for the circuit fig. 3: i. 11,... Question: Use mesh analysis to calculate the following currents for the circuit fig. 3: i. 11, 12 ii. IA, IB, Ic, ID, IE, IF 3 Ω 3A 13 2 22 5 Ω 21 12 5V 10Ω 20v Fig. 3... 1 answer ##### 6. [-/1 Points) DETAILS ROLFFM8 2.3.038. Solve the system of equations (if possible). (If there are... 6. [-/1 Points) DETAILS ROLFFM8 2.3.038. Solve the system of equations (if possible). (If there are infinitely many solutions, express X1, X2, and x3 in terms of the parameter t. If X1 + 3x2 5x3 = 11 3x1 2X2 = 10 2X1 5x2 10X3 - 9 15x3 (X1, X2, X3) - Need Help? Watch It Talk to a Tutor Additional Mat... 1 answer ##### We were unable to transcribe this imageWe were unable to transcribe this imageComplete this question by... We were unable to transcribe this imageWe were unable to transcribe this imageComplete this question by entering your answers in the tabs below. Required 1 Required 2 Complete a depreciation schedule for Units-of-production method. (Do not round intermediate calculations.) Income Statement Depreciat... 1 answer ##### A SIEM analyst noticed a spike in activities from the guest wireless network to several electronic... A SIEM analyst noticed a spike in activities from the guest wireless network to several electronic health record (EHR) systems. After further analysis, the analyst discovered that a large volume of data has been uploaded to a cloud provider in the last six months. Which of the following actions shou... 1 answer ##### Of cyclohexane and toluene have been? Comment on the overall shape ("s"-shaped vs. gradually sioping) of... of cyclohexane and toluene have been? Comment on the overall shape ("s"-shaped vs. gradually sioping) of the distillation curve. Questions: (Attach this shoot to your notebook carbon copies for evaluation) AT 32°C, the vapor pressure of pure cyclohexane is 125 mm Hg and the vapor pressur... 1 answer ##### RUN  VI Use Matlab to obtain plots of the following spectrums for: -5s ws5: 1.... RUN  VI Use Matlab to obtain plots of the following spectrums for: -5s ws5: 1. Yi (w)-5 (w) 2. Y2(w)-5 o(w-3) 4. Y(w)- 10 5. Ys(w)-1-u(-w) 6. Y(w) sin(3w) 8. Ys(w)cos(3w) 9. Yo(w) jw +I RUN  VII obtain the inverse Fourier transform of the functions defined in RUN  VI, by hand if possible or by us... 1 answer ##### 7. Last year Rational Co. bought a new building for$7,500,000, taking out a mortgage of...
7. Last year Rational Co. bought a new building for $7,500,000, taking out a mortgage of$5,000,000 secured against the property. The com- pany spent $2,000,000 on new equipment for the new property and also sold unwanted vehicles for$100,000. Required Calculate the cash from or cash used in invest...


text:
# Basic Use¶

The easiest way to use Minpower is by using the minpower script from the command line. Simply create a folder (e.g. mycommitment/) containing spreadsheets to specify the power systems problem you are trying to solve. Spreadsheet creation is described in detail in Creating a Problem.

To solve the problem call:

minpower mycommitment

Your problem is created and sent to an optimization solver on your computer and the results (in spreadsheet and graphical forms) are saved to the folder. Basic use is as easy as that.

You can also specify a number of options from the command line. For example, to use the CPLEX solver:

minpower mycommitment --solver cplex

A full list of options is available by calling:

minpower --help

There are many examples of Minpower problems in the test folders on github.


text:
# Thread: Constants for Composition of functions

1. ## Constants for Composition of functions

Let f(x) = ax+b and g(x) =cx+d where a,b,c,d are constants. Determine for which constants a,b,c,d it is true that f o g = g o f.

I am not very sure how to approach this problem. I simplifed the f o g and g o f but after that I am not sure how to go from there.

Here is what I did first

f(g(x)) = g(f(x))
a(cx+d) +b = c(ax+b) +d
acx+ad+b = cax + cb +d

then after that I got stuck. I tried switching around the varibles on either side and tried to get them to equal to eachother, however that didn't work. Am I'm going in the right direction or am I totally off? Thank you for your help!!!

acx-acx = cb +d
ad+b = cb +d
ad -d = cb -b
d(a-1) = b(c-1)

that is where I got stuck

Thank you for your help!

2. Originally Posted by hotmail590
Let f(x) = ax+b and g(x) =cx+d where a,b,c,d are constants. Determine for which constants a,b,c,d it is true that f o g = g o f.

I am not very sure how to approach this problem. I simplifed the f o g and g o f but after that I am not sure how to go from there.

Here is what I did first

f(g(x)) = g(f(x))
a(cx+d) +b = c(ax+b) +d
acx+ad+b = cax + cb +d

then after that I got stuck. I tried switching around the varibles on either side and tried to get them to equal to eachother, however that didn't work. Am I'm going in the right direction or am I totally off? Thank you for your help!!!

acx-acx = cb +d
ad+b = cb +d
ad -d = cb -b
d(a-1) = b(c-1)

that is where I got stuck

Thank you for your help!
You are almost there, but may be expecting something cleverer than is
actualy the case.

First $f \circ g = g \circ f$ gives as you observe:

$acx+ad+b = cax + cb +d$,

which rearranges to:

$(ac-ca)x + ad+b-cb+d=0$,

Which holds when:

$ad+b-cb+d=0$.

Which is all there is to it; other than rearranging this last equation to as
neat a form as possible. I like:

$\frac {a-1}{b}=\frac{c-1}{d}$

RonL

3. Would it be safe to conclude that the constants a b c d may be all real numbers however a must equal to c and b must equal to d?

Thank you very much for your quick reply CaptainBlack!!!

4. Originally Posted by hotmail590
Would it be safe to conclude that the constants a b c d may be all real numbers however a must equal to c and b must equal to d?
Yes. When a=c and b=d, the equation becomes an identity.

f(x) = ax +b
g(x) = cx +d

For f o g = g o f,
a(cx +d) +b = c(ax +b) +d
acx +ad +b = acx +bc +d
The acx cancels out,
ad +b = bc +d
ad -d = bc -b
d(a-1) = b(c-1) ---------***

So if a=c and b=d,
b(c-1) = b(c-1)
Or,
d(a-1) = d(a-1)

5. Originally Posted by hotmail590
Would it be safe to conclude that the constants a b c d may be all real numbers however a must equal to c and b must equal to d?

Thank you very much for your quick reply CaptainBlack!!!
It is true that $a, b, c,$ and $d$ may be any real numbers which satisfy:

$
\frac {a-1}{b}=\frac{c-1}{d}
$

So if $a=2$ and $c=4$ then any $b$ and $d$
will do as long as $d=3b$.

RonL

,

,

,

### f:-ax b (a and b are constants ) and d: x maps onto2x 3 are two functions. If fg is equal to gf, find the relationship between and b

Click on a term to search for related topics.


text:
# yule.cov

From ape v2.1-1
0th

Percentile

##### Fits the Yule Model With Covariates

This function fits by maximum likelihood the Yule model with covariates, that is a birth-only model where speciation rate is determined by a generalized linear model.

##### Usage
yule.cov(phy, formula, data = NULL)
##### Arguments
phy
an object of class "phylo".
formula
a formula specifying the model to be fitted.
data
the name of the data frame where the variables in formula are to be found; by default, the variables are looked for in the global environment.
##### Details

The model fitted is a generalization of the Yule model where the speciation rate is determined by:

$$\ln\frac{\lambda_i}{1 - \lambda_i} = \beta_1 x_{i1} + \beta_2 x_{i2} + \dots + \alpha$$

where $\lambda_i$ is the speciation rate for species i, $x_{i1}, x_{i2}, \dots$ are species-specific variables, and $\beta_1, \beta_2, \dots, \alpha$ are parameters to be estimated. The term on the left-hand side above is a logit function often used in generalized linear models for binomial data (see family). The above model can be written in matrix form:

$$\mathrm{logit} \lambda_i = x_i' \beta$$

The standard-errors of the parameters are computed with the second derivatives of the log-likelihood function. (See References for other details on the estimation procedure.)

The function needs three things:

a phylogenetic tree which may contain multichotomies;

a formula which specifies the predictors of the model described above: this is given as a standard R formula and has no response (no left-hand side term), for instance: ~ x + y, it can include interactions (~ x + a * b) (see formula for details);

the predictors specified in the formula must be accessible to the function (either in the global space, or though the data option); they can be numeric vectors or factors. The length and the order of these data are important: the number of values (length) must be equal to the number of tips of the tree + the number of nodes. The order is the following: first the values for the tips in the same order than for the labels, then the values for the nodes sequentially from the root to the most terminal nodes (i.e. in the order given by phy\$edge).

The user must obtain the values for the nodes separately.

Note that the method in its present implementation assumes that the change in a species trait is more or less continuous between two nodes or between a node and a tip. Thus reconstructing the ancestral values with a Brownian motion model may be consistent with the present method. This can be done with the function pic but currently needs some hacking! A NULL value is returned, the results are simply printed. Paradis, E. (2005) Statistical analysis of diversification with species traits. Evolution, 59, 1--12. [object Object] branching.times, diversi.gof, diversi.time, ltt.plot, birthdeath, bd.ext, yule ### a simple example with some random data data(bird.orders) x <- rnorm(45) # the tree has 23 tips and 22 nodes ### the standard-error for x should be as large as ### the estimated parameter yule.cov(bird.orders, ~ x) ### compare with the simple Yule model, eventually ### with a likelihood ratio test yule(bird.orders) ### another example with a tree that has a multichotomy ### but we cannot run yule() because of this! data(bird.families) y <- rnorm(272) # 137 tips + 135 nodes yule.cov(bird.families, ~ y) models

##### Aliases
• yule.cov
Documentation reproduced from package ape, version 2.1-1, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.


text:
We're sorry Aspose doesn't work properply without JavaScript enabled.

# Request for Support - Retrieving Word by Word Bounding Information in .docx Files

Dear Aspose Support Team,

I hope this email finds you well. I am writing to request your assistance with a problem I am facing while using the Aspose library.

I am working on a project that involves retrieving bounding box information from a .docx file, specifically word by word information. I am using the Aspose.Words library and have been trying to use the getPageInfo().getBounds() method and other similar methods, but I have noticed that these methods are not available in the latest version of Aspose.Words. I have also tried using the LayoutNode and Rect classes, but they are also not found.

I would like to inform you that I already have a Developer License for Aspose.Words.

I am using Aspose.Words version 22.10 and would greatly appreciate it if you could provide any guidance or examples on how to retrieve the word by word bounding information from a .docx file using this version of the library.

Thank you for your time and consideration. I look forward to your response.

Best regards,
Manikandan B

@bmanitn As you may know, MS Word documents are flow documents and do not contain any information about document layout. The consumer applications, like MS Word or Open Office builds document layout on the fly. Aspose.Words uses it’s own layout engine to build document layout to render the document to PDF or any other fixed page formats and for printing. Also, Aspose.Words provides LayoutCollector and LayoutEnumerator classes, that allows to get layout information from the document.
Your requirements can be achieved using LayoutCollector and LayoutEnumerator classes. It is required to wrap each word in your document into a bookmark and then determine rectangle of bookmark start and bookmark end using LayoutCollector and LayoutEnumerator. Union of these rectangles will give you bounding box of the word calculated by Aspose.Words layout engine. For example see the following code:

Document doc = new Document("C:\\Temp\\in.docx");

// Regular expression that match one or more word characters sequence.
Pattern wordRegex = Pattern.compile("\\w+");

// Use replace functionality to split runs in the document so they contain only one word.
FindReplaceOptions opt = new FindReplaceOptions();
opt.setUseSubstitutions(true);
doc.getRange().replace(wordRegex, "\$0", opt);

// Now wrap each "word" run into a bookmark.
int bkIndex = 0;
Iterable<Run> runs = doc.getChildNodes(NodeType.RUN, true);
for (Run r : runs)
{
// LayoutCollector and LayoutEnumerator classes does not work with nodes in header/footer.
continue;

// Skip Runs with text that does not match the regular expression (whitespaces)
if (!wordRegex.matcher(r.getText()).matches())
continue;

String bkName = "word_bookmark_" + bkIndex;
bkIndex++;
wordBookmakrs.put(bkName, r);

r.getParentNode().insertBefore(new BookmarkStart(doc, bkName), r);
r.getParentNode().insertAfter(new BookmarkEnd(doc, bkName), r);
}

// Create LayoutCollector and LayoutEnumerator
LayoutCollector collector = new LayoutCollector(doc);
LayoutEnumerator enumerator = new LayoutEnumerator(doc);

// Print bounding boxes of runs with words.
for (String bkName : wordBookmakrs.keySet())
{
Run r = wordBookmakrs.get(bkName);
Bookmark bk = doc.getRange().getBookmarks().get(bkName);

enumerator.setCurrent(collector.getEntity(bk.getBookmarkStart()));
Rectangle2D startRect = enumerator.getRectangle();
enumerator.setCurrent(collector.getEntity(bk.getBookmarkEnd()));
Rectangle2D endRect = enumerator.getRectangle();

// Union of the start and end rectangles is the bounding box of the run.
Rectangle2D result = startRect.createUnion(endRect);

System.out.println(r.getText() + " -----  " + result);
}


text:
# Simplest way to typeset entire document in sans serif (Helvetica)

How do I typeset an entire document in Helvetica/sans serif without littering the document with font changes for every heading/paragraph, etc.? Like this but with the paragraphs all in Helvetica.

For example, I've seen documents typeset in Computer Modern and then switched to Palatino, but can I do the same with Helvetica with a few commands at the beginning?

(And please don't tell me to use a serif font for body copy / paragraphs. I know. I'm trying to use latex to typeset my resume to look like the one I've created in a word processor, which is hard to maintain but looks good. I'm hoping latex will let me do more advanced formatting/layout, separating content from form.)

-

\renewcommand{\familydefault}{\sfdefault} will switch to using sans-serif for everything except mathematics. The sans-serif will be computer modern sans unless you also put \usepackage{helvet} in the preamble in order to make the default sans be Helvetica (or \usepackage{avant} for Avant-Garde, etc.
@Lev, Is there a package that does this automatically?, that is, without the ugly \renewcommand{\familydefault}{\sfdefault} code. (Nothing against it, but this is the kind of code makes me embarrassed to explain to newcomers) – alfC Mar 22 at 20:50


text:
Searching....

# 11.2.11 Poisson Boundary Conditions

(February 4, 2022)

Each of the implicit solvation models described above is designed for isotropic, bulk solvation—conditions that can be qualitatively described using a scalar dielectric constant, $\varepsilon$. For an anisotropic environment, such as a liquid/vapor interface, a more general approach is to solve Poisson’s equation with a spatially-varying dielectric function, $\varepsilon(\mathbf{r})$. Such an approach can be used, for example, to model the air/water interface by describing certain regions of space using $\varepsilon=1$ (air) and other regions using $\varepsilon=78$ (water).222, 221 The atomistic region is described at the SCF level. Construction of the dielectric function $\varepsilon(\mathbf{r})$ is based on a solute cavity, somewhat analogous to the solute cavity in a PCM calculation but where the dielectric changes smoothly (rather than abruptly) from $\varepsilon=1$ inside the cavity (in the atomistic QM region) to $\varepsilon=\varepsilon_{\rm solvent}$ outside, in the continuum solvent. Options for modeling a liquid/vapor interface are also available; see Section 11.2.11.3. In contrast to PCMs, which must approximate the “volume polarization” due to penetration of the tails of the QM charge density beyond the solute cavity, this effect is described exactly under Poisson boundary conditions. The price to be paid for lifting this approximation is that charge densities must be discretized and integrated over three-dimensional space rather than simply a two-dimensional solute cavity surface.

Q-Chem’s implementation of the Poisson Equation Solver (PEqS) method was introduced in Ref. 222 and refined in Refs. 221 and 861. Support for dielectric media with finite ionic strength was added in Ref. 1077. Users of this methodology are asked to cite at least Refs. 221 and and 861.

## 11.2.11.1 Theory

The most general formulation of Poisson’s equation, for a dielectric function rather than a dielectric constant, is

 $\hat{\bm{\nabla}}\bm{\cdot}\left[\varepsilon(\mathbf{r})\hat{\bm{\nabla}}% \varphi_{\rm tot}(\mathbf{r})\right]=-4\pi\rho_{\rm sol}(\mathbf{r})\;.$ (11.26)

The solute’s charge density will be separated into nuclear and electronic components,

 $\rho_{\rm sol}(\mathbf{r})=\rho_{\rm nuc}(\mathbf{r})+\rho_{\rm elec}(\mathbf{% r})\;.$ (11.27)

The total electrostatic potential $\varphi_{\rm tot}$ is comprised of the solute’s electrostatic potential $\varphi_{\rm elec}+\varphi_{\rm nuc}$, which is obtained from the density in Eq. (11.27), plus the polarization potential induced in the medium:

 $\varphi_{\rm tot}(\mathbf{r})=\varphi_{\rm elec}(\mathbf{r})+\varphi_{\rm nuc}% (\mathbf{r})+\varphi_{\rm pol}(\mathbf{r})\;.$ (11.28)

To compute $\rho_{\rm elec}$, the electronic contribution to the electrostatic potential in vacuum is first evaluated on a Cartesian grid,

 $\varphi_{\rm elec}(\mathbf{r}_{i})=\sum_{\mu\nu}^{N_{\rm basis}}P_{\mu\nu}% \Bigl{\langle}g_{\mu}(\mathbf{r})\Bigl{|}\frac{1}{|\mathbf{r}-\mathbf{r}_{i}|}% \Bigr{|}g_{\nu}(\mathbf{r})\Bigr{\rangle}\;.$ (11.29)

Here P is the one-electron density matrix, $g_{\mu}$ and $g_{\nu}$ are atom-centered Gaussian basis functions, and the integration is over $\mathbf{r}$. The electronic part of the solute’s charge density is then obtained from

 $\rho_{\rm elec}(\mathbf{r})=-\frac{1}{4\pi}\hat{\nabla}^{2}\varphi_{\rm elec}(% \mathbf{r})\;,$ (11.30)

where in practice the Laplacian of $\varphi_{\rm elec}$ is evaluated using an eighth-order finite difference scheme.221 The nuclear charge density $\rho_{\rm nuc}$ is described classically,

 $\rho_{\rm nuc}(\mathbf{r})=-\sum_{A}^{N_{\rm atoms}}Z_{\!A}\ \delta\left(% \mathbf{r}-\mathbf{R}_{A}\right)\;,$ (11.31)

but to avoid numerical problems the nuclear charges are smeared out over one Cartesian grid voxel in practice. Operationally, this is achieved by adding $Z_{A}/dV$ to the grid point nearest $\mathbf{R}_{A}$, where $dV$ is the volume of a Cartesian voxel. The exact nuclear electrostatic potential in vacuum is computed according to

 $\varphi_{\rm nuc}(\mathbf{r})=-\frac{1}{4\pi}\sum_{A}^{N_{\rm atoms}}\frac{Z_{% \!A}}{|\mathbf{r}-\mathbf{R}_{A}|}\;.$ (11.32)

The Dirac delta function in Eq. (11.31) has dimensions of (volume)${}^{-1}$ and therefore incorporates the aforementioned factor of $dV^{-1}$

Having computed the electronic and nuclear charge densities and the electrostatic potentials in vacuum, one has in hand an exact solution of Eq. (11.26) for the case where $\varepsilon(\mathbf{r})=1$. The induced polarization charge density and corresponding electrostatic potential are then obtained iteratively, following closely the procedure outlined in Refs. 321 and 41. Equation (11.26) is rewritten to appear as Poisson’s equation in vacuum with an additional source charge density:

 \displaystyle\begin{aligned} \displaystyle\hat{\nabla}^{2}\varphi_{\rm tot}(% \mathbf{r})&\displaystyle=-4\pi\left[\frac{\rho_{\rm sol}(\mathbf{r})}{% \varepsilon(\mathbf{r})}+\frac{\hat{\bm{\nabla}}\ln\varepsilon(\mathbf{r})\bm{% \cdot}\hat{\bm{\nabla}}\varphi_{\rm tot}(\mathbf{r})}{4\pi}\right]\\ &\displaystyle=-4\pi\bigl{[}\rho_{\rm sol}(\mathbf{r})+\rho_{\rm pol}(\mathbf{% r})\bigr{]}\;,\end{aligned} (11.33)

where the polarization charge density is

 $\rho_{\rm pol}(\mathbf{r})=\rho_{\rm iter}(\mathbf{r})+\left(\frac{1-% \varepsilon(\mathbf{r})}{\varepsilon(\mathbf{r})}\right)\rho_{\rm sol}(\mathbf% {r})\;.$ (11.34)

The iterative charge density $\rho_{\rm iter}(\mathbf{r})$ takes the form

 $\rho_{\rm iter}^{(k+1)}(\mathbf{r})=\frac{\hat{\bm{\nabla}}\ln\varepsilon(% \mathbf{r})\bm{\cdot}\hat{\bm{\nabla}}\varphi^{(k)}_{\rm tot}(\mathbf{r})}{4\pi}$ (11.35)

at iteration $k+1$. This function is nonzero only in transition regions where the dielectric is being interpolated from vacuum to solvent. Note also that the second term in Eq. (11.34) vanishes wherever $\varepsilon(\mathbf{r})=1$. The quantity $\rho_{\mathrm{iter}}(\mathbf{r})$ is iterated to convergence by performing updates $\rho_{\mathrm{iter}}^{(k)}(\mathbf{r})\rightarrow\rho_{\mathrm{iter}}^{(k+1)}(% \mathbf{r})$ using Eq. (11.35), taking $\varphi^{(0)}_{\mathrm{tot}}(\mathbf{r})$ to be the solute’s electrostatic potential in vacuum. Each time $\rho_{\rm iter}(\mathbf{r})$ is updated, a new polarization charge density is generated and Eq. (11.33) is solved to obtain a new total electrostatic potential. To stabilize the iterative updates of $\rho_{\rm iter}(\mathbf{r})$, we use a damping procedure

 \displaystyle\begin{aligned} \displaystyle\rho_{\rm iter}^{(k+1)}(\mathbf{r})&% \displaystyle=\frac{\eta}{4\pi}\bigl{[}\hat{\bm{\nabla}}\ln\varepsilon(\mathbf% {r})\bm{\cdot}\hat{\bm{\nabla}}\varphi^{(k)}_{\rm tot}(\mathbf{r})\bigr{]}+(1-% \eta)\rho_{\rm iter}^{(k)}(\mathbf{r})\\ &\displaystyle=\eta\rho_{\rm iter}^{(k+1)}+(1-\eta)\rho_{\rm iter}^{(k)}(% \mathbf{r})\end{aligned} (11.36)

rather than using Eq. (11.35) as written. Following Refs. 321 and 41, we use $\eta=0.6$.

Once the total charge density and electrostatic potential are iterated to self-consistency, the free energy of solvation,

 $G_{\rm pol}=\frac{1}{2}\int d\textbf{r}\;\varphi_{\rm pol}(\textbf{r})\;\rho_{% \rm sol}(\mathbf{r})\;,$ (11.37)

is computed, where

 $\varphi_{\rm pol}(\textbf{r})=\varphi_{\rm tot}(\textbf{r})-\varphi_{\rm sol}(% \mathbf{r})\;.$ (11.38)

Since $\varphi_{\mathrm{tot}}$ and $\rho_{\mathrm{tot}}$ are computed self-consistently at each SCF iteration, the polarization effects must be incorporated into the Fock matrix. This is accomplished by adding the correction term $\Delta\hat{F}=\delta G_{\mathrm{pol}}/\delta\rho_{\mathrm{elec}}$. The matrix form of this correction in the atomic orbital basis is

 $\Delta F_{\mu\nu}=\int d\textbf{r}\;\varphi_{\rm pol}(\textbf{r})\;g_{\mu}(% \textbf{r})\;g_{\nu}(\textbf{r})\;.$ (11.39)

For additional details and a full description of the algorithm, see Ref. 221.

## 11.2.11.2 Nonequilibrium Solvation for Vertical Ionization

Nonequilibrium solvation within the framework of PCMs is discussed in Section 11.2.3.3, and that methodology776, 1261 has been adapted for vertical ionization processes in conjunction with Poisson boundary conditions.222, 221 A state-specific approach has been implemented that requires solution of a nonlinear Schrödinger equation, Eq. (11.7). For the reference state, corresponding to $i=0$ in Eq. (11.7), this is equivalent to solving Eq. (11.26) for the induced polarization potential and computing the solvation free energy and Fock matrix correction according to Eqs. (11.37) and (11.39), respectively. For the ionized state, denoted by a subscript $i$, the solvent polarization is partitioned into fast and slow components. Within the Marcus partitioning scheme,1261 Eq. (11.33) becomes221

 $-\frac{1}{4\pi}\hat{\nabla}^{2}\varphi_{{\rm tot},i}(\mathbf{r})=\rho_{{\rm sol% },i}(\mathbf{r})+\rho^{\rm slow}_{{\rm pol},0}(\mathbf{r})+\rho^{\rm fast}_{{% \rm pol},i}(\mathbf{r})\;,$ (11.40)

where the fast polarization charge density of the ionized state, $\rho^{\rm fast}_{{\rm pol},i}$, is given by

 $\rho^{\rm fast}_{{\rm pol},i}(\mathbf{r})=\rho_{{\rm iter},i}(\mathbf{r})+% \left(\frac{1-\varepsilon_{\rm opt}(\mathbf{r})}{\varepsilon_{\rm opt}(\mathbf% {r})}\right)\bigl{[}\rho_{{\rm sol},i}(\mathbf{r})+\rho^{\rm slow}_{{\rm pol},% 0}(\mathbf{r})\bigr{]}$ (11.41)

and the fast polarization potential, $\varphi^{\rm fast}_{{\rm pol},i}$, is

 $\varphi^{\rm fast}_{{\rm pol},i}(\textbf{r})=\varphi_{{\rm tot},i}(\textbf{r})% -\varphi_{{\rm sol},i}(\mathbf{r})-\varphi^{\rm slow}_{{\rm pol},0}(\mathbf{r}% )\;.$ (11.42)

Subscripts $i$ and 0 refer to the ionized state and the reference state, respectively. The quantity $\varepsilon_{\rm opt}$ in Eq. (11.41) is the solvent’s optical dielectric constant, and $\rho_{{\rm iter},i}$ is computed using Eq. (11.36) but with a dielectric function constructed using $\varepsilon_{\rm opt}$ and with $\varphi^{\rm fast}_{{\rm tot},i}$ substituted in place of $\varphi_{\rm tot}$. For the Marcus partitioning scheme, the slow component of the induced solvent polarization charge density is computed as the three-dimensional (volume charge rather than surface charge) analogue of Eq. (11.9).

## 11.2.11.3 Job Control for the Poisson Equation Solver

A calculation using Poisson boundary conditions is requested by setting SOLVENT_METHOD = PEQS in the $rem section. For computational efficiency, the Poisson Equation Solver (PEqS) is typically not engaged until the error in the vacuum SCF calculation falls below a specified threshold, taken to be $10^{3}~{}E_{h}$ by default and user-controllable by means of the$rem variable PEQS_SWITCH.

Note:  When PEqS solvation is requested, symmetry and the standard nuclear orientation are disabled automatically, equivalent to SYM_IGNORE = TRUE and NO_REORIENT = TRUE. Poisson’s equation is solved on a three-dimensional Cartesian grid and the energy need not be rotationally invariant unless the grid spacing is very small.

PEQS_SWITCH

PEQS_SWITCH
Inclusion of solvent effects begins when the SCF error falls below 10${}^{-\rm PEQS\_SWITCH}$.
TYPE:
INTEGER
DEFAULT:
3
OPTIONS:
$n$ Corresponding to 10${}^{-n}$
RECOMMENDATION:
Use the default unless solvent effects need to be incorporated earlier in the SCF procedure.

Further job control for the Poisson equation solver (PEqS) routines is set up in two sections: $peqs_grid and$peqs. (An optional third section, $epsilon, is discussed later.) The$peqs_grid section is used to define the Cartesian discretization grid, as follows:

$peqs_grid DimX <Nx> <Xmin> <Xmax> DimY <Ny> <Ymin> <Ymax> DimZ <Nz> <Zmin> <Zmax>$end

The Cartesian grid must be orthorhombic and Nx, Ny, and Nz refer to the number of grid points for the $x$, $y$, and $z$ axes.

Note:  A fourth-order multigrid algorithm is used to accelerate convergence of the conjugate gradient PEqS routine that solves Eq. (11.33).221 This requires that the number of grid points be odd, with the additional constraint that the quantities $N_{x}-1$, $N_{y}-1$, and $N_{z}-1$ must all be divisible by 8.

Values in the last two columns of the $peqs_grid section specify the minimum and maximum values of $x$, $y$, and $z$, in units of Ångstroms. The length of the grid in the $x$ direction is $L_{x}=x_{\rm max}-x_{\rm min}$ and the grid spacing is $\Delta x=L_{x}/(N_{x}-1)$. The volume element discussed in the context of Eq. (11.31) is $dV=\Delta x\Delta y\Delta z$. The$peqs section controls other aspects of a PEqS calculation, including construction of the solute cavity and other required parameters for interfacial or nonequilibrium solvation. The format is:

$peqs <Keyword> <parameter/option>$end

Available keywords are described below.

MaxIter
Sets the maximum number of iterations used in the conjugate gradient solver.
INPUT SECTION: $peqs TYPE: INTEGER DEFAULT: 500 OPTIONS: User-defined. RECOMMENDATION: Use the default unless the calculation fails to converge. SolverThresh The electrostatic potential is considered converged when the error falls below 10${}^{-\rm PEQSolverThresh}$. INPUT SECTION:$peqs
TYPE:
INTEGER
DEFAULT:
5
OPTIONS:
$n$ Corresponding to 10${}^{-n}$
RECOMMENDATION:
Use the default unless a tighter convergence criterion is desired, at greater computational cost.

PolarIterScale
Specifies the mixing parameter $\eta$ that is used in Eq. (11.36) to stabilize iterative solution for the polarization charge density.
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: 0.6 OPTIONS: $\eta$ Desired value of the mixing parameter (unit-less). RECOMMENDATION: Use the default, which was tested in Refs. 321 and 41, unless the calculation proves difficult to converge. BatchSize Evaluate electrostatic potential integrals in batches over small parts of the Cartesian grid, rather than computing all integrals in a single batch. INPUT SECTION:$peqs
TYPE:
INTEGER
DEFAULT:
5000
OPTIONS:
$n$ Corresponding to a batch size of $n$ grid points.
RECOMMENDATION:
For large grids ($\geq 10^{6}$ grid points), a batch size $n\approx N_{x}N_{y}N_{z}/5$ is recommended.

SolventDielectric
Sets the dielectric value for the solvent.
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: 78.39 OPTIONS: $\varepsilon$ Desired value of $\varepsilon$ (dimensionless). RECOMMENDATION: The default value corresponds to water at 25${}^{\circ}$C. OpticalDielectric Sets the optical dielectric value of the solvent. INPUT SECTION:$peqs
TYPE:
FLOAT
DEFAULT:
1.7778
OPTIONS:
$\varepsilon_{\rm opt}$ Desired value of $\varepsilon_{\rm opt}$ (dimensionless).
RECOMMENDATION:
The optical dielectric is equal to the square of the index of refraction. The default value corresponds to water at 25${}^{\circ}$C.

SoluteCavity
Specifies the type of solute cavity, which determines the form of the dielectric function $\varepsilon(\mathbf{r})$.
INPUT SECTION: $peqs TYPE: STRING DEFAULT: Vacuum OPTIONS: Vacuum Perform calculation in vacuum, $\varepsilon(\mathbf{r})\equiv 1$. RigidVDW Create a cavity using spherically symmetric error functions. Spherical Create a single spherical cavity around the solute. Arbitrary Create a user-defined dielectric cavity as obtained from the$epsilon input section.
RECOMMENDATION:
None.

In conventional PCMs the solute cavity is a rigid two-dimensional surface constructed from a union of atomic spheres, the radii of which are generally take to be equal to the van der Waals radius ($r_{\rm vdW}$) scaled by a factor of 1.2; see Section 11.2.4.457 This cavity is rigid in the sense that once the atomic coordinates are specified, it remains unchanged during the SCF cycles. (The isodensity cavity discussed in Section 11.2.6 is an exception, but is not available for the PEqS method.) Furthermore, there is an abrupt and discontinuous change in the dielectric constant at the solute/continuum boundary. A three-dimensional analogue of this cavity, using continuous and differentiable spherically-symmetric error functions, has been implemented for PEqS calculations, following the procedure in Ref. 321. The permittivity function, which depends parametrically on the nuclear positions $\mathbf{R}_{A}$, is

 $\varepsilon(\mathbf{r};\{\mathbf{R}_{A}\})=\bigl{(}\varepsilon_{\rm solvent}-1% \bigr{)}\ \left\{\prod_{A}^{N_{\rm atoms}}h(d_{A},\Delta;\lvert\mathbf{r}-% \mathbf{R}_{A}\rvert)\right\}\;,$ (11.43)

where

 $h(d_{A},\Delta;\lvert\mathbf{r}-\mathbf{R}_{A}\rvert)=\frac{1}{2}\left[1+{\rm erf% }\left(\frac{\lvert\mathbf{r}-\mathbf{R}_{A}\rvert-d_{A}}{\Delta}\right)\right% ]\;.$ (11.44)

Equation (11.43) smoothly interpolates between $\varepsilon=1$ and $\varepsilon=\varepsilon_{\rm solvent}$, over a length scale of $\approx 4\Delta$. The value of $\Delta$ is specified using the RigidScale keyword. The quantity $d_{A}$ in Eqs. (11.43) and (11.44) sets radius of the atomic sphere for atom $A$. By default, $d_{A}=1.2\,r_{\rm vdW}$ but this can be controlled as described below.

RigidScale
Sets the length scale on which the error function employed in the rigid vdW cavity construction interpolates the dielectric value from vacuum to solvent.
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: 0.265 Å OPTIONS: $\Delta$ Specifies the desired value (in Å); see Eq. (11.44). RECOMMENDATION: Use the default value, which was tuned in Ref. 321 so that errors in small-molecule solvation energies were $\approx 1$ kcal/mol. VDWType Specifies details for the rigid vdW cavity construction. INPUT SECTION:$peqs
TYPE:
STRING
DEFAULT:
Scaled
OPTIONS:
Unscaled $d_{A}=r_{\mathrm{vdW}}$ Scaled $d_{A}=r_{\mathrm{vdW}}\times scale$ Shifted $d_{A}=(r_{\mathrm{vdW}}+shift)\times scale$
RECOMMENDATION:
None. The values of $scale$ and $shift$ are set with the VDWScale and VDWShift keywords.

VDWScale
Sets the empirical scale factor applied to the atomic van der Waals radius.
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: 1.2 OPTIONS: $scale$ Specifies the desired dimensionless scaling factor for the atomic vdW radii. RECOMMENDATION: Use the default value. VDWShift Adjusts the center of the spherically-symmetric error functions when constructing the rigid vdW cavity. INPUT SECTION:$peqs
TYPE:
FLOAT
DEFAULT:
0.0 Ångstroms
OPTIONS:
$shift$ Specifies the desired shift (in Å).
RECOMMENDATION:
None. If VDWType is set to Shifted, the vdW scale factor is set to 1.0 by default. This can be adjusted using the VDWScale keyword.

Setting the SoluteCavity keyword to Spherical requests the construction of a spherical cavity around the solute, and the dielectric is smoothly interpolated from vacuum to solvent using a hyperbolic tangent function:222

 $\varepsilon(r)=\frac{1}{2}\Bigl{\{}(\varepsilon_{\mathrm{solvent}}+1)+(% \varepsilon_{\mathrm{solvent}}-1)\ \mbox{tanh}\bigl{[}\alpha(r-r_{\mathrm{mid}% })\bigr{]}\Bigr{\}}\;.$ (11.45)

Here, $r_{\mathrm{mid}}$ is the distance where the dielectric assumes the value $\varepsilon(r_{\mathrm{mid}})=(\varepsilon_{\mathrm{solvent}}+1)/2$. The value of $r_{\mathrm{mid}}$ is taken to be the sum of the sphere radius, $R$, and half of the interpolation length, $L$: $r_{\mathrm{mid}}=R+L/2$. The sphere radius and interpolation length are controlled with the SphereRadius and InterpolLength keywords described below. The parameter $\alpha$ controls the sharpness of the switching process, with $\alpha=4/L$ by default.

SphereRadius
Sets the radius of the spherical solute cavity.
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: No default. OPTIONS: $R$ Desired spherical cavity radius (in Å). RECOMMENDATION: None. See the Supporting Information of Ref. 222 for more information. InterpolLength Sets the length scale on which the dielectric is smoothly interpolated from vacuum to solvent. INPUT SECTION:$peqs
TYPE:
FLOAT
DEFAULT:
No default.
OPTIONS:
$L$ Desired interpolation length (in Å).
RECOMMENDATION:
None.

InterpolScale
For a given interpolation length ($L$), InterpolScale ($\alpha$) sets the sharpness of the dielectric transition from vacuum to solvent.
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: $\alpha$ = $4/L$ OPTIONS: $\alpha$ Desired interpolation scale factor (in Å${}^{-1}$). RECOMMENDATION: Use the default unless a broader (smaller $\alpha$) or narrower (larger $\alpha$) transition region is desired. Interface Perform a solvation calculation at a solvent/vacuum interface. INPUT SECTION:$peqs
TYPE:
STRING
DEFAULT:
False
OPTIONS:
True Modify the dielectric function to simulate an interface between solvent and vacuum. False Perform a solvation calculation in bulk solvent.
RECOMMENDATION:
The user will also need to specify the length scale on which the dielectric is smoothly interpolated from the bulk solvent value to vacuum, and the location of the Gibbs dividing surface (see below).

By setting Interface = True, the dielectric function on the Cartesian grid is further modified to mimic a solvent/vacuum interface. First, the solute cavity is constructed as specified by the SoluteCavity keyword as discussed above. Then, the dielectric function is smoothly interpolated in the $z$ direction across the Gibbs dividing surface ($z\equiv z_{\mathrm{GDS}}$) using the following hyperbolic tangent switching function:222, 221

 $\varepsilon(z)=\frac{1}{2}\Bigl{\{}(\varepsilon_{\rm solvent}+1)+(1-% \varepsilon_{\rm solvent})\ \mbox{tanh}\bigl{[}\beta(z-z_{\mathrm{GDS}})\bigr{% ]}\Bigr{\}}\;.$ (11.46)

This interpolates the dielectric function over the interface length $L_{\rm interface}$, centered at the Gibbs dividing surface, $z\equiv z_{\mathrm{GDS}}$. Both of these values are controlled by the keywords InterfaceLength and GibbsDS, respectively. Similar to the parameter $\alpha$ used in the spherical cavity construction, the parameter $\beta=4/L_{\rm interface}$ controls the sharpness of the interpolation across the Gibbs dividing surface.

InterfaceLength
Sets the length scale over which the dielectric function is smoothly transitioned from bulk solvent to vacuum in the $z$ direction
INPUT SECTION: $peqs TYPE: FLOAT DEFAULT: None OPTIONS: $L_{\rm interface}$ Desired interface length (in Å). RECOMMENDATION: This sets the value $\beta=4/L_{\rm interface}$ in Eq. (11.46). See the Supporting Information of Ref. 222 for a full description of the solvent/vacuum interface construction. GibbsDS Sets the location of the Gibbs dividing surface, in the $z$ direction. INPUT SECTION:$peqs
TYPE:
FLOAT
DEFAULT:
None
OPTIONS:
$z_{\mathrm{GDS}}$ Desired location of the Gibbs dividing surface (in Å).
RECOMMENDATION:
Consult the literature. One such way to determine this value is to compute a density profile of the solvent as a function of $z$ and set this location to be where the solvent density has decreased to 50% of the bulk value. Usually $z_{\mathrm{GDS}}\approx L_{\rm interface}/2$.

NonequilJob
Obtain the nonequilibrium free energy of solvation for a vertical ionization process.
INPUT SECTION: $peqs TYPE: STRING DEFAULT: False OPTIONS: True Compute the nonequilibrium free energy for a vertical ionization process. False Compute the equilibrium solvation free energy. RECOMMENDATION: None. NonequilPartition Specifies the manner in which the solvent response is partitioned into fast and slow components. INPUT SECTION:$peqs
TYPE:
STRING
DEFAULT:
Marcus
OPTIONS:
Marcus Employ the Marcus partitioning scheme. Pekar Employ the Pekar partitioning scheme.
RECOMMENDATION:
Use the default. Although the fast and slow solvation responses are different between the two approaches, the total solvation free energy is the same,1261 but the Pekar scheme is computationally more expensive than the Marcus scheme.

NonequilState
Specifies the state of interest for a nonequilibrium vertical ionization.
INPUT SECTION: $peqs TYPE: STRING DEFAULT: Reference OPTIONS: Reference The reference (initial) state, from which an electron will be removed. Ionized The final (ionized) state. RECOMMENDATION: None. Both values will be needed in a compound input job, in order to compute the non-equilibrium response to vertical ionization; see Example 11.2.11.4. Lastly, by setting SoluteCavity to Arbitrary in the$peqs input section, the user may choose to specify a completely user-defined permittivity function $\varepsilon(\mathbf{r})$,31 which must be generated externally and input into Q-Chem pointwise on the PEqS grid, using a $epsilon section in the input file. The format for that section consists of Cartesian grid points $(x_{i},y_{i},z_{i})$ following by $\varepsilon(x_{i},y_{i},z_{i})$, as shown below. $epsilon
x1  y1  z1    eps(x1,y1,z1)
x1  y1  z2    eps(x1,y1,z2)
. . .
x1  y1  zNz   eps(z1,y1,zNz)
x1  y2  z1    eps(x1,y2,z1)
. . .
x1  y2  zNz   eps(z1,y2,zNz)
. . .
. . .
xNx  yNy  zNz    eps(xNx,yNy,zNz)
$end  ## 11.2.11.4 Examples The following example computes the solvation free energy of a water molecule immersed in water. The Cartesian grid is cubic with a side length of 15.0 Å and 73 grid points in each direction. A rigid vdW cavity is used based on scaled vdW radii for the atomic spheres. The dielectric is not set, so takes the default value of 78.39. Example 11.19 Free energy of solvation of water in water. $molecule
0 1
O     0.053004    -0.020947    -0.034784
H     0.003424     0.185855     0.910594
H    -0.844842     0.146674    -0.358413
$end$rem
EXCHANGE          wB97X-V
BASIS             6-31+G*
SCF_CONVERGENCE   5
THRESH            14
SOLVENT_METHOD    PEQS
PEQS_SWITCH       0
$end$peqs
SOLUTECAVITY RIGIDVDW
$end$peqs_grid
DimX 73 -7.50 7.50
DimY 73 -7.50 7.50
DimZ 73 -7.50 7.50
$end  View output The next example illustrates calculation of the solvation free energy of a water molecule at a water/vacuum interface, with the Gibbs dividing surface placed at $z=0.50$ Å. The length of the interface is set to $L_{\rm interface}=2.75$ Å and the dielectric is interpolated from bulk solvent to vacuum in the positive $z$ direction across the Gibbs dividing surface. The Cartesian grid, solute cavity, and solvent dielectric are the same as in the previous example. Example 11.20 Free energy of solvation of water at a water/vacuum interface. $molecule
0 1
O     0.053004    -0.020947    -0.034784
H     0.003424     0.185855     0.910594
H    -0.844842     0.146674    -0.358413
$end$rem
SCF_CONVERGENCE   5
THRESH            14
EXCHANGE          wB97X-V
BASIS             6-31+G*
SOLVENT_METHOD    PEQS
PEQS_SWITCH       0
$end$peqs
SOLUTECAVITY RIGIDVDW
INTERFACE TRUE
INTERFACELENGTH 2.75
GIBBSDS 0.50
INTERFACEDIRECTION POSITIVE
$end$peqs_grid
DimX 73 -7.50 7.50
DimY 73 -7.50 7.50
DimZ 73 -7.50 7.50
$end  View output The final example illustrates a nonequilibrium (NonEquilJob = True) solvation calculation for the vertical ionization of $\rm H_{2}O^{-}$ in bulk water. This is a compound job that first calculates the equilibrium solvation free energy of the anionic state (NonEquilState = Reference), then computes the nonequilibrium energy correction for the ionized state (NonEquilState = Ionized). The two jobs are separated by “@@@”. The Cartesian grid and solvent dielectric are the same as the previous examples, but the solute cavity is chosen to be spherical with a radius of 2.0 Å. The Marcus scheme (NonEquilPartition = Marcus) is used to partition the solvent response into fast and slow components. Since this is the default method, the NonEquilPartition keyword is omitted. Example 11.21 Nonequilibrium free energy of solvation for the vertical ionization of $\rm H_{2}O^{-}$ $molecule
-1 2
O     0.053004    -0.020947    -0.034784
H     0.003424     0.185855     0.910594
H    -0.844842     0.146674    -0.358413
$end$rem
SCF_CONVERGENCE   5
THRESH            14
EXCHANGE          HF
BASIS             6-31++G*
SOLVENT_METHOD    PEQS
PEQS_SWITCH       0
$end$peqs
SOLUTECAVITY   SPHERICAL
SPHERERADIUS   2.00
NONEQUILJOB    TRUE
NONEQUILSTATE  REFERENCE
$end$peqs_grid
DimX 73 -7.50 7.50
DimY 73 -7.50 7.50
DimZ 73 -7.50 7.50
$end @@@$molecule
0 1
O     0.053004    -0.020947    -0.034784
H     0.003424     0.185855     0.910594
H    -0.844842     0.146674    -0.358413
$end$rem
SCF_CONVERGENCE   5
THRESH            14
EXCHANGE          HF
BASIS             6-31++G*
SOLVENT_METHOD    PEQS
PEQS_SWITCH       0
$end$peqs
SOLUTECAVITY   SPHERICAL
SPHERERADIUS   2.00
NONEQUILJOB    TRUE
NONEQUILSTATE  IONIZED
$end$peqs_grid
DimX 73 -7.50 7.50
DimY 73 -7.50 7.50
DimZ 73 -7.50 7.50
\$end

View output


text:
## Thinking Mathematically (6th Edition)

If the tree has $n$ vertices, then the number of edges is $n-1$.
A tree is a graph that is connected and does not have any circuits. In a tree, there is a simple relationship between the number of vertices and the number of edges. If the tree has $n$ vertices, then the number of edges is $n-1$.


text:
# DX11 having problems debugging SSAO

This topic is 375 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Please look at my new post in this thread where I supply new information!

I'm trying to implement SSAO in my 'engine' (based on this article) but I'm getting odd results. I know I'm doing something wrong but I can't figure out what's causing the particular issue im having at the moment.

" rel="external">Here's a video of what it looks like . The rendered output is the SSAO map.

As you can see the result is heavily altered depending on the camera (although it seems to be unaffected my camera translation). The fact that the occlusion itself isn't correct isn't much of a problem at this stage, since I've hardcoded a lot of stuff that shouldn't be. E.g. I don't have a random-vector texture, all I do is use one of the sample vectors in order to construct the TBN matrix.
One issue at a time...

//SSAO VS

struct VS_IN
{
float3 pos : POSITION;
float3 ray : VIEWRAY;
};

struct VS_OUT
{
float4 pos : SV_POSITION;
float4 ray : VIEWRAY;
};

VS_OUT VS_main( VS_IN input )
{
VS_OUT output;
output.pos = float4(input.pos, 1.0f);  //already in NDC space, pass through
output.ray = float4(input.ray, 0.0f); //interpolate view ray
return output;
}

Texture2D depthTexture  : register(t0);
Texture2D normalTexture : register(t1);

struct VS_OUT
{
float4 pos : SV_POSITION;
float4 ray : VIEWRAY;
};

cbuffer	cbViewProj : register(b0)
{
float4x4 view;
float4x4 projection;
}

float4 PS_main(VS_OUT input) : SV_TARGET
{
//Generate samples
float3 kernel[8];

kernel[0] = float3(1.0f, 1.0f, 1.0f);
kernel[1] = float3(-1.0f, -1.0f, 0.0f);

kernel[2] = float3(-1.0f, 1.0f, 1.0f);
kernel[3] = float3(1.0f, -1.0f, 0.0f);

kernel[4] = float3(1.0f, 1.0f, 0.0f);
kernel[5] = float3(-1.0f, -1.0f, 1.0f);

kernel[6] = float3(-1.0f, 1.0f, .0f);
kernel[7] = float3(1.0f, -1.0f, 1.0f);

//Get texcoord using SV_POSITION
int3 texCoord = int3(input.pos.xy, 0);

//Fragment viewspace position (non-linear depth)
float3 origin = input.ray.xyz * (depthTexture.Load(texCoord).r);

//world space normal transformed to view space and normalized
float3 normal = normalize(mul(view, float4(normalTexture.Load(texCoord).xyz, 0.0f)));

//Grab arbitrary vector for construction of TBN matrix
float3 rvec = kernel[3];
float3 tangent = normalize(rvec - normal * dot(rvec, normal));
float3 bitangent = cross(normal, tangent);
float3x3 tbn = float3x3(tangent, bitangent, normal);

float occlusion = 0.0;
for (int i = 0; i < 8; ++i) {
// get sample position:
float3 samp = mul(tbn, kernel[i]);
samp = samp * 1.0f + origin;

// project sample position:
float4 offset = float4(samp, 1.0);
offset = mul(projection, offset);
offset.xy /= offset.w;
offset.xy = offset.xy * 0.5 + 0.5;

// get sample depth. (again, non-linear depth)

// range check & accumulate:
occlusion += (sampleDepth <= samp.z ? 1.0 : 0.0);
}

//Average occlusion
occlusion /= 8.0;

return min(occlusion, 1.0f);
}

I'm fairly sure my matrices are correct (view and projection) and that the input rays are correct.
I don't think the non-linear depth is the problem here either, but what do I know  I haven't fixed the linear depth mostly because I don't really understand how it's done...

Any ideas are very appreciated!

Edited by GreenGodDiary

##### Share on other sites

Bumping with new information. I'm getting quite desperate, if someone could help me out I would be forever greatful<3

I have revamped my way of constructing the view space position. Instead of directly binding my DepthStencil as a shader resource (which thinking back made no sense to do), I'm now in the G-buffer pass outputting 'positionVS.z / FarClipDistance' to a texture and using that, and remaking my viewRays in the following way: (1000.0f is FarClipDistance)

		//create corner view rays
float thfov = tan(fov / 2.0);
float verts[24]
{
-1.0f, 1.0f, 0.0f, //Pos TopLeft corner
-1.0f * thfov * aspect, 1.0f * thfov, 1000.0f,	//Ray

1.0f, 1.0f, 0.0f, //Pos	TopRight corner
1.0f * thfov * aspect, 1.0f * thfov, 1000.0f,	//Ray

-1.0f, -1.0f, 0.0f,	//Pos BottomLeft corner
- 1.0f * thfov * aspect, -1.0f * thfov, 1000.0f,//Ray

1.0f, -1.0f, 0.0f, //Pos BottomRight corner
1.0f * thfov * aspect, -1.0f * thfov, 1000.0f,	//Ray
};

In my SSAO PS, I reconstruct view-space position like this:

	float3 origin = input.ray.xyz * (depthTexture.Load(texCoord).r);
origin.x *= 1000;
origin.y *= 1000;

Why do I multiply by 1000? Because it works. Why does it work? Don't know. But this gives me the same value that I had in the G-pass vertex shader. If someone knows why this works/why it shouldnt, do tell me.

Anyway, next I get the world-space normal from the G-buffer and multiply by my view matrix to get view-space normal:

	float3 normal = normalTexture.Load(texCoord).xyz;
normal = mul(view, normal);
normal = normalize(normal);

I now have a random-vector-texture that I sample.
Next I construct the TBN matrix using this vector and the view-space normal:

	float3 rvec = randomTexture.Sample(randomSampler, input.pos.xy).xyz;
rvec.z = 0.0;
rvec = normalize(rvec);
float3 tangent = normalize(rvec - normal * dot(rvec, normal));
float3 bitangent = normalize(cross(normal, tangent));
float3x3 tbn = float3x3(tangent, bitangent, normal);

This is where I'm not sure if I'm doing it right. I am doing it exactly like the article in the original post, however since he is using OpenGL maybe something is different here?
The reason this part looks suspicious to me is that when I later use it, I get values that to me don't make sense.

        float3 samp = mul(tbn, kernel[i]);
samp = samp + origin;

samp here is what looks odd to me. If the values are indeed wrong, I must be constructing my TBN matrix wrong somehow.

Next up, projecting samp in order to get the offset in NDC so that I can then sample the depth of samp:

		float4 offset = float4(samp, 1.0);
offset = mul(offset, projection);
offset.xy /= offset.w;
offset.xy = offset.xy * 0.5 + 0.5;

// get sample depth:
float sampleDepth = depthTexture.Sample(defaultSampler, offset.xy).r;

occlusion += (sampleDepth <= samp.z ? 1.0 : 0.0);

The result is still nowhere near what you'd expect. It looks slightly better than the video linked in the original post but still same story; huge odd artifacts that change heavily based on the cameras orientation.

What am I doing wrong?

help im dying

Edited by GreenGodDiary

Bump. (sorry)

##### Share on other sites

While just briefly reading the code (it's quite hard to say what is going on - your SSAO calculation doesn't look correctly to me though), here are few notes which might lead you to where the issue is:

• Make sure you know in which space you are - world space, view space, object space, etc. ... doing this wrong will be one of the reasons for view-dependent errors.
• Do NOT multiply by random constants that make it "look good" - make sure each constant has a reason why it is there. Put it in the comment.
• Compare everything - you can write how 'view space normals', 'view space position', etc. when generating G-Buffer (into another buffer), and compare against your reconstruction - this way you can proof that you have your input data correct

Now, for the SSAO:

• Make sure you're sampling in hemisphere ABOVE the point in direction of normal. From your specified vectors you will also attempt to sample in the opposite hemisphere.
• You will need some randomization (otherwise you will need a lot of samples to make SSAO look like anything resembling SSAO).
• I also recommend checking out other shaders doing SSAO - F.e. on ShaderToy - https://www.shadertoy.com/view/4ltSz2 - it might help you find what is wrong on your side (I'm intentionally adding it here, as if you compare the actual SSAO calculation, as yours does seem incorrect to me)

##### Share on other sites
8 hours ago, Vilem Otte said:

While just briefly reading the code (it's quite hard to say what is going on - your SSAO calculation doesn't look correctly to me though), here are few notes which might lead you to where the issue is:

• Make sure you know in which space you are - world space, view space, object space, etc. ... doing this wrong will be one of the reasons for view-dependent errors.
• Do NOT multiply by random constants that make it "look good" - make sure each constant has a reason why it is there. Put it in the comment.
• Compare everything - you can write how 'view space normals', 'view space position', etc. when generating G-Buffer (into another buffer), and compare against your reconstruction - this way you can proof that you have your input data correct

Now, for the SSAO:

• Make sure you're sampling in hemisphere ABOVE the point in direction of normal. From your specified vectors you will also attempt to sample in the opposite hemisphere.
• You will need some randomization (otherwise you will need a lot of samples to make SSAO look like anything resembling SSAO).
• I also recommend checking out other shaders doing SSAO - F.e. on ShaderToy - https://www.shadertoy.com/view/4ltSz2 - it might help you find what is wrong on your side (I'm intentionally adding it here, as if you compare the actual SSAO calculation, as yours does seem incorrect to me)

Thanks alot for these pointers, I will definitely look into it further using your advice.
One question though:

Quote

From your specified vectors you will also attempt to sample in the opposite hemisphere.

Are you sure this is the case? Because my kernels are in the range ([-1, 1], [-1, 1], [0, 1]), wont it exclusively sample from the "upper" hemisphere? Or am i thinking about it wrong?

Thanks again

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 27
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634101
• Total Posts
3015528
×


text:
Mathematics of Quantum Phases of Matter and Quantum Information

All abstracts
Size: 129 kb
Organizers:
• Paul Bruillard (Pacific Northwest National Laboratory)
• César Galindo (Universidad de los Andes)
• Julia Plavnik (Texas A&M University)
• Eric Rowell (Texas A&M University)
• Mary Beth Ruskai
University of Vermont
Extreme Points of Unital Quantum Channels
PDF abstract
Size: 38 kb
Several new classes of extreme points of unital and trace-preserving completely positive (CP) maps are analyzed. One class is not extreme in either the convex set of unital CP maps or the set of trace-preserving CP maps and is factorizable. Another class is extreme for both the set of unital CP maps and the set of trace-preserving CP maps, except for certain critical parameters. For those parameters the linear dependence of the matrices in the Choi product condition are associated with representations of the symmetric group. Joint work with U. Haagerup and M. Musat
Tecnológico de Monterrey, Campus Estado de México
SU(2) decomposition for complex quantum information hamiltonians generating entanglement
PDF abstract
Size: 96 kb
In the gate array version of Quantum Computation, the use of convenient and appropriate gates is essential. But while involved gates adopt convenient forms for the computational algorithms, in the practice, their design depends on specific quantum systems and physical interactions involved. Quantum resources and gates design are restricted to properties and limitations imposed by the physical elements considered in the set up. In addition, predictable and controllable manipulation procedures should be addressed on them. On this scenario, two level quantum systems are the basic elements to connect the binary nature of classical computation with quantum computation. This work presents a general approach to set control procedures by decomposing the dynamics in $SU(2^{2d})$ for $2d$-partite two level spin systems including entangling operations into $2^{2d-1}$ $SU(2)$ subsystems for the generalized Hamiltonian: \begin{eqnarray} \tilde{H} = \sum_{\{i_k\}}{h_{\{i_k\}}} \bigotimes_{k=1}^n \sigma_{i_k} = \sum_{\mathcal{I}=0}^{4^n-1}{h_{\mathcal{I}^n_4}} \bigotimes_{k=1}^n \sigma_{\mathcal{I}^n_{4,k}} \nonumber \end{eqnarray} by expressing the dynamics on proper basis: the generalized Bell states. Thus, binary operations naturally arise there. Still, alternating the directions of local (or possibly non-local) interaction terms in the Hamiltonian, the procedure states a universal exchange semantics on that basis. Thus, the structure developed can be understood as the splitting of the $2d$ physical systems in $2^{2d-1}$ pairs of $2$ level information channels.
• Alonso Botero
Asymptotic entanglement concentration of multi-qubit W states
PDF abstract
Size: 39 kb
While the general problem of multipartite entanglement concentration remains open, one can still show that for a certain class of multipartite states, the multi-qubit W class, it is possible to asymptotically concentrate the entanglement of n copies of the state into a single canonical “completely entangled” state (i.e., with maximally mixed one-particle density matrices), between local Hilbert spaces of high dimension. In this talk we show how this remarkable property of W states follows from the application of a multi-local Schur transform, permutation symmetry, and the algebra of SLOCC covaraints for W states, and how it in turn admits a concentration protocol akin to the distortion-free protocol of Hayashi and Matsumoto. If time permits, we will also discuss how the asymptotic tail exponents can be computed in principle, and discuss some partial results in this respect.
Tecnológico de Monterrey
Entanglement-tuned quantum walks
PDF abstract
Size: 39 kb
Quantum walks were originally developed as quantum-mechanical counterparts of classical random walks. In the early days of this cross-disciplinary research field, quantum walks were used just as a mathematical tool to develop sophisticated algorithms. Later on and in stark contrast to the algorithmic properties of classical random walks, it was proved that quantum walks constitute a universal model for quantum computation. Quantum entanglement is expected to play a key role in the formulation of quantum algorithms that are faster than their classical counterparts. Although some aspects of quantum entanglement and computational speed up have been studied, we lack a general framework to explicitly manipulate quantum entanglement for building quantum algorithms, being the ultimate purpose of such framework to provide quantum programmers with mathematical descriptions and subroutines in order to build algorithms for solving complex problems. The role of entanglement in quantum walks and quantum walk-based algorithms is an open area of research. Motivated by the wish to further study the effect of entanglement in discrete quantum walks, in this paper we shall present a preliminary framework for manipulating quantum walk parameters via quantum entanglement together with a succinct yet complete review of the state-of-the-art on the role of quantum entanglement in the definition and dynamics of quantum walks.
• Fiona Burnell
University of Minnesota
Hamiltonians for anyon permuting symmetries
PDF abstract
Size: 37 kb
Commuting projector Hamiltonians are closely related to discrete topological invariants. I will describe a general construction for commuting projector Hamiltonians that realize a global anyon-permuting symmetry in an on-site manner, and discuss their relationship with the gauged (equivariantized) version of these topological orders (and commuting projector Hamiltonians).
• Dominic Williamson
University of Vienna
Hamiltonian models for topological phases of matter in three spatial dimensions
PDF abstract
Size: 39 kb
We present commuting projector Hamiltonian realizations of a large class of (3+1)D topological models based on unitary G-crossed braided fusion categories. This construction comes with a wealth of examples from the physics literature on symmetry-enriched topological phases. The spacetime counterparts to our Hamiltonians are a family of unitary state sum topological quantum fields theories (TQFTs), recently defined by Cui, that appear to capture all known constructions in the literature, including the Crane-Yetter-Walker-Wang and 2-Group gauge theory models. We also present Hamiltonian realizations of another state sum TQFT family, recently constructed by Kashaev, whose relation to existing models was previously unknown. We argue that these TQFTs are captured as a special case of the Crane-Yetter-Walker-Wang model, with a premodular input category in some instances.
• Jon Yard
University of Waterloo and Perimeter Institute
Topological phases and arithmetic
PDF abstract
Size: 37 kb
In this talk, I will present various applications of arithmetic to the study of topological phases. I will first discuss joint work illustrating the role played by different kinds of equivalence classes of quadratic forms in the classification of abelian topological phases. I will also present examples of arithmetic groups arising from images of braid group representations associated to certain nonabelian phases.
• Xie Chen
Caltech
Group Cohomology and Symmetry Protected Topological Phases
PDF abstract
Size: 37 kb
The mathematical concept of Group Cohomology has recently played an important role in condensed matter physics, in the study of Symmetry Protected Topological Phases. In this talk, I am going to discuss the development in this field. In particular, I am going to discuss how group cocycles can be used to construct condensed matter models with global symmetry and how nontrivial group cocycle leads to models with nontrivial physical effect when the system is placed on a manifold with boundary. Open questions and future directions are also discussed.
• Paulo Teotonio-Sobrinho
Topological Order in Higher Gauge Theories and Cohomology
PDF abstract
Size: 64 kb
Quantum double models are good examples of quantum systems with topological order. They are lattice gauge theories with a finite gauge group. The lattice is described by a finite simplicial complex $X$ whereas gauge configurations are maps from the set of 1-simplices into the gauge group. Recently, higher gauge theory generalizations have appeared in the literature. Examples where a 2-group plays the role of the usual gauge group lead to interesting models and new topological phases. In this talk we are going to present a model with topological order that generalizes some of the ideas above. In our construction, the lattice is replaced by a chain complex $C$ of finitely generated free abelian groups and the gauge group is replaced by a chain complex $G$ of finite abelian groups. From this initial data, we construct a Hilbert space ${\cal H}$ and a frustration free Hamiltonian. Topological order is manifest when we describe the ground state space ${\cal H}_0\subset {\cal H}$ in terms of a cohomology with coefficients in a finite chain complex. This cohomology, denoted by $H^0(C,G)$, was first introduced by Ronald Brown in 1964. He proved that $H^0$ is isomorphic to a product of usual cohomology groups. This results allows us to compute the ground state degeneracy and to find a convenient set of quantum numbers that labels the states of ${\cal H}_0$. Abelian examples of 1-gauge and 2-gauge theories are recovered as special cases.
• Alex Bullivant
University of Leeds, UK
Higher Symmetry Topological Phases and Loop Braid Invariants
PDF abstract
Size: 41 kb
The non-Abelian exchange statistics of anyons in 2+1D topological phases of matter have received considerable interest in recent years due to the potential applications in topological quantum computation. Utilising the connection between topological phases of matter and extended Topological Quantum Field Theories (TQFT) has provided a powerful framework for understanding physically realistic models for realising anyons in condensed matter systems and providing representations of the braid group, describing the exchange of point particles. In 3+1D it is well known that the exchange of point particles is necessarily described by Bosonic or Fermionic exchange statistics. However, it has been shown that many models of 3+1D topological phases of matter naturally support loop-like excitations. When one loop is passed through another, these excitations support possibly non-Abelian exchange statistics generating the so called loop-braid group. In this talk I will outline a class of candidate 3+1D topological phases of matter arising from considerations in Higher Lattice Gauge Theory (HLGT)[1606.06639,1702.00868]. Such theories generalise Lattice Gauge Theories (LGT) with finite gauge group to the case of finite gauge 2-group which are described by crossed modules. I will then utilise this construction and ideas from extended TQFT to define representations of loop-braids within the HLGT framework.
• Xingshan Cui
Stanford University
State Sum Invariants of Three Manifolds from Spherical Multi-fusion Categories
PDF abstract
Size: 48 kb
We define a family of quantum invariants of closed oriented $3$-manifolds using spherical multi-fusion categories. The state sum nature of this invariant leads directly to $(2+1)$-dimensional topological quantum field theories ($\text{TQFT}s$), which generalize the Turaev-Viro-Barrett-Westbury ($\text{TVBW}$) $\text{TQFT}$s from spherical fusion categories. The invariant is given as a state sum over labeled triangulations, which is mostly parallel to, but richer than the $\text{TVBW}$ approach in that here the labels live not only on $1$-simplices but also on $0$-simplices. It is shown that a multi-fusion category in general cannot be a spherical fusion category in the usual sense. Thus we introduce the concept of a spherical multi-fusion category by imposing a weakened version of sphericity. Besides containing the $\text{TVBW}$ theory, our construction also includes the recent higher gauge theory $(2+1)$-$\text{TQFT}$s given by Kapustin and Thorngren, which was not known to have a categorical origin before.
• Qing Zhang
Texas A&M University
Congruence Subgroups and Super-Modular Categories
PDF abstract
Size: 38 kb
A super-modular category is a unitary ribbon fusion category with Müger center equivalent to the unitary symmetric ribbon category of super-vector spaces. For modular categories, Ng and Schauenburg showed that the kernel of the associated projective representation of the modular group is a congruence subgroup. In the super-modular setting, one gets a representation of the theta subgroup of the modular group by taking the fermionic modular quotient. It is conjectured that the kernel of this representation is also congruence of some level. We verify this for any super-modular category having a minimal modular extension. We also provide evidence for the conjecture by looking at super-modular categories arising from quantum groups at roots of unity.
• Dmitri Nikshych
University of New Hampshire
Classifying braidings on fusion categories
PDF abstract
Size: 57 kb
It is well known that braidings on a fusion category $C$ are in bijection with sections of the forgetful functor $Z(C)\to C$, where $Z(C)$ is the center of $C$. We extend this observation by proving that braidings on fusion categories Morita equivalent to $C$ are parameterized by pairs $(A,\, S)$ consisting of a Lagrangian algebra $A$ in $Z(C)$ and a fusion subcategory $S \subset Z(C)$ transversal to $A$ and such that $\dim(S) = \dim(C)$. We use this to classify braidings on group-theoretical and on factorizable fusion categories. We discuss a relation between these results and the Belavin-Drinfeld classification of $r$-matrices for simple Lie algebras.