Given a plot of a network Graph[] how can the {x,y} screen coordinates be output?

Is there a general way to get the screen or "world" coordinates for every vertex in the graphic output of something like this?

Table[Graph[Table[i \[UndirectedEdge] i + 1, {i, 20}],    GraphLayout -> l,    PlotLabel -> l],  {l, {"CircularEmbedding", "SpiralEmbedding"}}] 

Trying to build an algorithm to generate novel layouts and want to use a large amount of other algorithms for training data.

Hardwiring the output in quantum black box separation

In this paper, while using a diagonalization argument in Section $ 5$ , the authors write:

Fix some enumeration over all $ poly(n)$ -size quantum verifiers $ M_{1}, M_{2},…$ which we can do because the number of such machines is countably infinite (by the Solovay-Kitaev theorem [15]). Some of these verifiers may try to decide a language by trivially “hardwiring” its outputs; for example, by returning 1 independent of the input. We start by fixing a unary language $ L$ such that no machine $ M_{i}$ hardwires the language. We can always do this because there are more languages than $ poly(n)$ -sized machines.

Maybe I am missing something very basic, but:

  1. Why do we care if some of the verifiers have the output hardwired?
  2. How can we find an $ L$ , like in the description? Why will this $ L$ even be decidable? I know there are more languages than there are Turing machines; but those extra languages aren’t decidable.

How does each element in the output array of a DFT correspond to a specific frequency?

I have a basic understanding of the Fourier Transform, though I’m trying to use it in a program and I’m confused on the specifics. Based on source code I can find online, the DFT takes a set of samples/numbers, performs a summation for each term, and returns a set of these summations which is the same size as the input set. Suppose I have a periodic function. As I understand it, the output array should contain the amplitudes/weights of each frequency which sum to that function. What I can’t figure out is how each frequency is encoded in the array as just an index. In each example I read, we just assign a summation at each iteration of the inner loop to the next consecutive index in the output array. How are these indices indicative of which frequency they correspond to?

I’m attaching the source code I’m referencing to the bottom of this in case the website I linked to ever goes down.

import cmath def compute_dft_complex(input):     n = len(input)     output = []     for k in range(n):  # For each output element         s = complex(0)         for t in range(n):  # For each input element             angle = 2j * cmath.pi * t * k / n             s += input[t] * cmath.exp(-angle)         output.append(s)     return output 

Have I been hacked ( netstat output too many dgrams and stream connections) [closed]

enter image description hereenter image description here

enter image description here

netstat output

These are the output images of the netstat command I ran it shows that they’re are too many outbound connection and many dgrams and stream . I also tried to capture the output using Wireshark and then reverse checking the IP address to whom does it belongs ( using it showed up various organisation ( Google, Astricia).

I also tried to turnoff the wifi and then ran netstat but no change in the dgram and stream connections.

Please help , any input will be appreciated.

How can I get 8 bits output from 4 bit CPU?

I am very new to Computer architecture. I am thinking to add one more output register to this 4 bit CPU as shown below. However, I am not sure should I connect the output register to the current CPU. Should I connect it just the same way as the current one and label the 2 output register as output A and output B? But if I connect it the same way, the input data from ALU to output registers will always be only 4 bits, how should I get 8 bits output from the two output registers? enter image description here

Rice’s Theorem for Turing machine with fixed output

So I was supposed to prove with the help of Rice’s Theorem whether the language: $ L_{5} = \{w \in \{0,1\}^{*}|\forall x \in \{0,1\}^{*}, M_{w}(w) =x\}$ is decidable.

First of all: I don’t understand, why we can use Rice’s Theorem in the first place: If I would chose two Turingmachines $ M_{w}$ and $ M_{w’}$ with $ w \neq w’$ then I would get $ M_{w}(w) = M_{w’}(w) = x$ . But this would lead to $ w’$ not being in $ L_{5}$ and $ w \in L_{5}$ . Or am I misunderstanding something?

Second: The solution says, that the Language $ L_{5}$ is decidable as $ L_{5} = \emptyset$ because the output is clearly determined with a fixed input. But why is that so? I thought that $ L_{5}$ is not empty because there are TM which output x on their own input and there are some which do not.

What is a ‘clean’ way of getting the output required?

I need to aggregate the total for when the case when statement returns true. But I need to do this per partition. My data looks something like this:

Product|Variation_code|Total_product_variations|Discount_code A      | x21          |          3             |     OFF A      | x22          |          3             |     LIQ A      | x23          |          3             |     NON B      | x4           |          2             |     LIQ B      | x9           |          2             |     LIQ C      | x34          |          4             |      C      | X36          |          4             |     OFF C      | x39          |          4             |     NON C      | x37          |          4             |     OFF 

I want the total count per product where Discount_code = ‘LIQ’

I have tried CASE WHEN(Discount_code = 'LIQ' then 1 else 0 end) AS total_liq but it returns 1 or 0 in each row.

Similarly, COUNT(CASE WHEN Discount_code = 'LIQ' THEN 1 ELSE 0 END)AS total_liq returns a bunch of single 1’s like so:

Product|Variation_code|Total_product_variations|Discount_code | total_liq A      | x21          |          3             |     LIQ      |    1      A      | x22          |          3             |     LIQ      |    1 

There is a group by 1,2,3,4,5 at the end of each of these. How do I go about achieving this?

I can’t roll variation_code into product or filter as I need to be able to see them later.

How do you output custom code before a subset of posts in the loop?

I have a foreach loop for a custom post type ordered by date (meta key). If a post’s associated date is less than the current date (i.e., dates not in the future), I want to output some HTML. if ($ custom_post_date >= $ today && $ index === 1) The problem I am running into is that the HTML gets output after the first post that is in the past. How can I output the HTML before the first post that meets the criteria? Is there a way to go back in the foreach loop or something to that effect?

Proof of Co-Problem being in NP if Problem is in NP using negated output

Given any problem $ P$ that we know of being in $ NP-\text{complete}$ , where is the flaw in the following proof?

Given a problem $ Co-P$ which is the co-problem of $ P \in NP-\text{complete}$ , $ Co-P$ is at least in $ NP$ because the following algorithm can always be given:

Co-P(J):     bool res = P(J)     return !res 

Where $ Co-P(J)$ is the algorithm solving $ Co-P$ and $ P(J)$ is the nondeterministic polynomial algorithm solving P.

Why is this not correct?

Using the features embedding of the output from a transformers to represent probabilities of categorical data

I was considering using a transformer, on input data which can be represented as an embedding, so I can use the attention mechanism in the transformer architecture. As my data is of variable input and output length and the input is sequential. My question is that my output data is suppose to be either numerical or probabilities for each output variable. The output was originally supposed to 13 numerical outputs but I decided to use a probability score as way of normalizing the output. My question is can I use two output vectors with 7 features each instead of 13 numeric outputs. Each feature would map to one of the original output vectors and the the last feature would always be 0. As PyTorch expects your output to be the same number of features as your input. My input variables are embedded as 7 features. Should this approach work, as I am unsure of how the loss function works or is there a loss function that would allow for this.