diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzznwyf" "b/data_all_eng_slimpj/shuffled/split2/finalzznwyf" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzznwyf" @@ -0,0 +1,5 @@ +{"text":"\\section{Introduction}\nOur purpose was to build a high performance supercomputer from PC elements.\nWe use PCs for two reasons. They have excellent cost\/performance ratios \n\\cite{pricewatch} and\n can easily be upgraded when faster motherboards and CPUs will be available.\nThe PMS project\nstarted in 1998, and the machine is now ready for physical calculations.\nOur first PMS machine (PMS1) consists of 32 PCs arranged in a three-dimensional \n$2 \\times 4 \\times4$ mesh. Each node has two special\ncommunication cards providing fast communication through flat cables \nto the six neighbours.\nThis gives a much better performance than simple Ethernet link.\n\nSince the machine is built from PCs, the latest versions of all programming\nlanguages (such as C and Fortran) can be used for coding. Writing applications is\nstraightforward. One only has to keep in mind the 3-dimensional mesh \nstructure of the\nmachine; no further deep understanding of how the communication works is\nrequired. There\nare some routines written in C that make communication of data between the\nnodes easy. The machine works in Single Instruction Multiple Data (SIMD) mode: all\nprocessors execute the same program, while the data they work on may differ.\n\nNowadays double precision floating point arithmetic is necessary for accurate\nresults. PMS offers this precision since the processors have double\nprecision Floating Point Units (FPUs). In cases when single precision is\nenough, the special MMX instruction set of AMD K6-2 processors can be used. \nThis provides a much higher performance, in principle 8 times higher, \nthan the standard double precision mode.\n\nThe following sections describe the hardware and software architectures\nof PMS. We first give a short overview of the machine and then describe \nthe hardware and the software in more detail. Some performance results are \nalso presented, and an outlook is given.\n\n\n\n\\section{Overview}\nThe nodes in PMS are based on PC components. In our first PMS machine (PMS1)\nthe rack containes four trays (see Fig. \\ref{pms_full}).\nThese trays hold eight nodes in two rows.\nEach node is powered by its own standard PC power supply located at the\nbottom of the rack. \nAppropriate air cooling by ventilation is provided for.\nNotice, that rack mounting is not\nrequired for the present communication speed of PMS1.\n Even PCs within their own cases can be used.\n\n Each node in PMS is an almost complete PC.\nIn PMS1 the configuration of a node consists of a \n100MHz motherboard (SOYO SY-5EHM), \na single 450MHz AMD K6-II processor,\n128Mbyte (7nsec) SDRAM, \n10Mbit Ethernet card, \nand a hard disk of caoacity 2.1 Gbyte.\n\n\\begin{figure}\n \\centerline{\n \\epsfig{file=trays.eps,height=7cm}\n }\n \\caption[hl]{The PMS1 rack and the trays.\n \\label{pms_full}\n }\n\\end{figure}\n\nThe nominal speed of each node is 225 Mflop, since floating point\noperations of the AMD processor require two clock cycles. The price of one\nnode was approximately \\$350 (for the price of such a computer see\n\\cite{pricewatch}). The additional cost for the communication cards (see\nlater) is \\$40 for each node. So the price\/performance ratio is reasonably\nlow.\n\n\nPMS uses special hardware for communication (PMS CH)\nto make high speed parallel\ncalculations possible. \nThe basic idea behind the hardware is that the PMS CH provides direct connection \nof each node to its nearest neighbours (NN). \nThe PMS CH handles both polled port (PP) IO operations and direct memory access (DMA)\nbetween two selected nodes.\n\nThe PP IO mode is quite straightforward; \nthe sender node sends a word and a flag indicating that\na word is being sent. The sender holds the data until the receiver node sends an \nacknowledgement signal after reading the data. \nIn case of the DMA the problem is synchronization\nbetween the sender and the receiver. Typical usage of DMA assumes data transfer between a PC\nand an another device. This device is usually either a slave or a bus master with \nappropriate circuits. \nIf DMA is used to transfer data between two PCs then one has to deal with\nsynchronization between two DMA chips. Both problems are solved by using \nFirst In First Out (FIFO) data buffers for read(receive) and write(send) \noperations and appropriate hardware hand-shaking circuits.\n\nPrior to data transfer the direction of the data flow must be decided.\nAlso, using DMA transfer receiving and sending procedures must be \ninitiated in a synchronized fashion since long delays in DMA\nmay lead to system crash. The PC architecture limits this synchronization\nto 2-30 bus clocks since both DMA and the interrupt have an \ninvoking latency (which is not defined by the bus protocol and may depend on the\nchip-set applied on the motherboard).\n\nProgramming the PMS CH is a fairly simple task. It can be done under \n Linux and 32-bit (extended) DOS operating systems. \nAll low-level device drivers are written\nin C and the programmer may use all kinds of commercial, share-ware or free-ware\ncompilers. Using the communication drivers requires the knowledge of only a \nfew functions.\nA simple programming example for Linux users can be found in the Appendix.\n\nThe PMS architecture does not define the bus used for the PMS CH.\nIn PMS1 we have used the simplest ISA bus (see Fig. \\ref{pms_ISA}).\nImplementation of the PMS CH for other, faster buses is under development.\n\n\n\n\nOur first implementation of the PMS CH includes two plug-in ISA cards, \nthe PMS CPU card and the PMS Relay card. \n\\begin{figure}\n \\centerline{\n \\epsfig{file=ISA.eps,height=7cm}\n \\epsfig{file=c2.eps,height=7cm}\n }\n \\caption[a]{a, The PMS CPU and Relay cards. b, Nodes connected by flat cables in one direction.\n \\label{pms_ISA} \n }\n\\end{figure}\nThe nodes are arranged in a $2 \\times 4 \\times4$ mesh as shown in Fig. \n\\ref{pms_grid}.\nIn each node both the PMS CPU and the PMS Relay cards are installed\nproviding a fast communication to the six NNs.\nAt the boundaries periodic boundary conditions are realized as indicated in \nFig. \\ref{pms_grid} where the links at the boundaries correspond to the ones on the other sides.\nThis determines the hardware architecture of the machine, which is\nsimilar to that of the APE machines \\cite{APE}.\n\n\n\n\\begin{figure}\n \\centerline{\\epsfig{file=pmscluster.eps,width=7cm}}\n \\caption[h]{The PMS cluster \\label{pms_grid}}\n\\end{figure}\n\n Debian Linux 2.1 is installed on each node. After turning the power on\neach node boots from its own hard-disk. All nodes can be accessed through the\nEthernet network. There is a main computer that controls the whole cluster.\nSome simple Linux scripts have been written to copy the executable\nprogram code\nand the appropriate data to and from the nodes and to execute the programs.\nCollecting the results is also managed by a simple Linux script.\nIn principle, Ethernet connection could be used for data transfer between the nodes during simulations. However, \nthis turns out to be too slow in most cases. One major reason for this is\nthat any data transfer between two machines makes the whole network busy.\nSince building up the Ethernet connection is quite slow even for two\ncomputers, the Ethernet connection is not satisfactory. The \ntheoretical maximum \nof the Ethernet connection speed is 1 Mbyte\/sec.\nThis bottleneck could be avoided by using switch boxes, however efficient \nswitch boxes are far too expensive and would dominate the price of the\nentire machine (cf. Fig. \\ref{compare} and the corresponding discussion \nin the text below.)\n\nThe special communication cards --described in more detail in the next\nsection-- provide faster communication between adjacent nodes. However, this\nmakes the machine applicable to local problems only, where\ncommunication only between the neighbouring nodes is necessary. In PMS1 \nthe speed of \ncommunication through these cards --limited essentially by the ISA bus speed-- \nis 2 Mbyte\/sec, which is greater than\nthe speed of our Ethernet by a factor of two. Furthermore to build up our \ncommunication practically no time is needed, while the build-up of the \nEthernet connection is rather slow.\nEven more 16 pairs of machines can\nsimultaneously communicate. Altogether we get two orders of magnitude \nbetter performance. Note that the system is scalable.\nOne can build machines with larger number of nodes. The\ntotal inter-node communication performance is proportional to the\nnumber of nodes.\n\nThe whole computer is rack mounted. This way the flat cables needed for \ncommunication are relatively short. At current communication speeds\nthis is not necessary. However, for future developments when communication\ngets much faster this can be crucial.\n\n\\section{Description of PMS Communication Hardware (CH) }\n\nThere are two communication cards in each machine. The CPU card contains\nthe main\ncircuits needed for transmitting data, while the Relay card contains the\nconnectors for the flat cables connecting the adjacent nodes and some\nadditional circuits.\n\\begin{figure}\n \\centerline{\\epsfig{file=pmscard.eps,width=7cm}}\n \\caption[h]{The PMS communication card \\label{card_scem}}\n\\end{figure}\nThe block diagram of the cards is shown in Fig. \\ref{card_scem}. \nThe circuits of both\ncards are included. There are two 16-bit buffers,\nthe output buffer and the input buffer, which accept the data coming from the\ncomputer and from one of the adjacent nodes, respectively. The Control\nRegister\nis used --among other things-- to clear the buffers and set the node to\neither\nsender or receiver state.\nThe Cable Select\ncircuit selects which direction the data is sent to or received from. The six\ndirections are labelled as left (L), right (R), up (U), down (D), front (F),\nback (B).\nIf the same physical cable is selected by two adjacent nodes, one of them set\nas sender\nand the other as receiver, a physical connection is established and the\ncontent of the output register of the sender is\nimmediately transferred to the receiver's input register.\nThe Local State Indicator (LSI) and the Remote State Indicator (RSI) are two\nregisters\nto indicate the states of the nodes. There are 12 LSI and 12 RSI lines. They\ncorrespond\nto sending to and receiving from the six directions.\nEach node can indicate its request for sending or receiving through the LSI\nlines.\nThe RSI lines are identical to the six neighbours' LSI lines.\nIf there is a match between RSI and LSI signals (i.e. a send and a\ncorresponding receive request coincide) then the Match Any (MA) bit is set\nand an IRQ\nis generated on the PC bus. The interrupt is generated on both nodes at the\nsame time, so\nthe interrupt handlers on both machines can safely start transferring data\nwithout any extra syncronization. The data can be transferred either \nby DMA or by consecutive I\/O operations.\n\nThe Cable Select circuit, the LSI, RSI and MA registers together with the\nflat\ncable connectors are located on the relay card, while all other circuits are\nlocated on the CPU card.\n\n\n\\section{Software}\n\nAs mentioned above, the whole cluster is connected via an Ethernet\nnetwork. Each node has a special hostname that corresponds\nto its location in the cluster. \nThe hostnames\nare s000,s001,s002,s003,s010 $\\dots$ s133. The numbers in the \nhostname correspond to the coordinates of the node in the\nthree dimensional mesh.\nWhen it is necessary for a node to identify itself (e.g. write\/read priorities\nduring inter-node communication, see below) the\nfile '\/etc\/hostname' is used. The Ethernet network is used only \nfor job management, i.e. to distribute\nand collect data to and from the nodes. It is not used for \ninter-node communication during simulations. This is achieved \nby the special hardware described in the previous section.\n\nIn order to take advantage of the fast communication from applications\n(e.g. high level C, C++ or Fortran code),\na low-level Linux kernel driver has been developed to access all the registers\nof the communication card. From the user level cards can simply be reached by\nreading or writing the device files '\/dev\/pms0, \/dev\/pms1 ... \/dev\/pms5'.\nThe six device files correspond to the six directions. A write operation\nto one of these device files will \ntransmit data to the corresponding direction, and reading from these device \nfiles reads\nout previously transferred data. All the necessary input\/output operations for\ntransferring data blocks are performed by the device driver. Notice the\nimportant feature that this can be reached from any high level \nC, C++, Fortran code for which compilers are available.\n\nThe main structure of the device driver is similar to that of the card.\nThere are six read buffers, one for each direction in the main memory of the\nmachine and there is one write buffer. The data are always written to the write\nbuffer and read out from one of the read buffers.\n\nThe driver has two main parts. The first part is accessed from applications when\nthe user writes or reads any of the device files '\/dev\/pms*'. The other part is\nthe interrupt handler where the real data transfer takes place.\n\nWhenever data are written to one of the device files, all the driver does is to\ncopy the written data to the write buffer and set the corresponding LSI send\nsignal to\nindicate that a data send is requested. If the buffer is already full,\nan error byte is returned to the application. Reading from the device files is\nsimilar: if there are data in the corresponding read buffer, they are sent to the\napplication and the LSI receive line is set, since the node is ready to receive\nnew data. If the read buffer is empty, an 'End Of File' byte is returned to the\napplication.\n\nWhen there is a coincidence between corresponding LSI and RSI signals,\nan interrupt is generated by the card, which invokes the driver's\ninterrupt handler. It is the task of the handler to transfer data from the\nsender to the receiver.\nThe interrupt handlers on the two communicating nodes start almost at\nthe same time. The difference may only be a few clock cycles. There is,\nhowever, a need for synchronization. If the machines are ready to send\nor receive the first byte they indicate it with their LSI lines. Notice \nthat this will not cause an extra interrupt since interrupts are\ndisabled within the interrupt handler.\nThe sender first transmits the size of the package that will\nfollow in 16-bit words.\nIn the present version this is a 16-bit value, so the maximum size of a\npackage that can be transferred is 128 kbytes. Then the given\nnumber of 16-bit values follow. Each word from the sender's write buffer\nis copied to the receiver's read buffer. Finally, a 32-bit checksum is sent.\nThe receiver computes its own checksum and if it does not match the\nreceived checksum, it is indicated to the sender and the whole transfer\nis repeated. The final step in the interrupt handler is to clear the \nLSI lines of both nodes. On the one hand this indicates for the sender that the data\nhave been transferred and\nthe write buffer is empty again. On the other hand this tells the\nreceiver that the corresponding read buffer is full, so no new data can\narrive unless the buffer is emptied.\n\nThe buffer sizes are set in the driver to constant values. From the\nprevious paragraph it is clear that the maximum reasonable buffer size\nis 128 kbytes. In order to save memory, while allowing large packages\nat the same time the buffer size is set to only 64 kbytes at present.\n\nThe driver makes application programming quite easy. Communication can\nbe achieved by accessing the above mentioned device files. \nHowever, some C functions\nhave also been written to make writing applications even\nsimpler. These functions are the following:\n\n{\\it pms\\_open} is used to initialize the card. It clears all\nbuffers, sets the LSI receive lines, clears the LSI send lines and\nenables interrupts. The node thus becomes ready to receive data from any of\nthe neighbours.\n\n{\\it pms\\_close} is used to close the card. All LSI lines\nare cleared and interrupts are disabled. No further\ncommunication may take place after this function call.\n\n{\\it pms\\_send, pms\\_recv} are used to send and\nreceive data. Their parameters are the direction, the number of bytes\nto send, and a pointer to the beginning of the data. On success they\nreturn a positive value, otherwise a negative one. If there is no data\nin the read buffer, {\\it pms\\_recv} returns 0.\n\nThe driver does not take care of any priority problems. It is possible\nto write applications that will not work since all nodes are waiting\nfor data while none of them is sending anything. This is often the case\nwhen the same code is running on all the nodes without any priority\ncheck. There is a simple solution to these kind of problems. The\nparity of the node is simply the\nparity of the sum of the three digits in its hostname. Each time when\ncommunication is performed, even nodes send data first and receive\nafterwards, while odd nodes receive first and send their data afterwards.\nThis simple method works in most cases. Note that the code for it \nis located in the application (C, C++ or Fortran) and not in the driver.\n\n\\section{Performance}\n\nWe carried out lattice gauge theory simulations on our parallel\ncomputer PMS. We used double precision variables. \nTwo types of theories were studied.\\\\\na. We analyzed the pure SU(3) gauge theory with the \nsimplest Wilson action. Overrelaxation and heatbath \nupdating algorithms were used for the link variables.\nThe most CPU time consuming part, manipulation with\n$3\\times 3$ matrices, was written in assembly language.\nThis increased the speed of the code by more than a factor \nof two.\\\\\nb. We studied the bosonic sector of the minimal\nsupersymmetric extension of the standard model (MSSM). \nSU(2) and SU(3) gauge fields were included with\ntwo complex Higgs doublets and with left and\nright handed coloured scalar quarks. Again, \noverrelaxation and heatbath updating algorithms were \nused for both gauge link variables and scalar site variables.\nThe microcanonical overrelaxation update for scalar quarks \nis quite complicated and new, its details will be\ndiscussed elsewhere \\cite{mssm_ewpt_prd}.\nManipulation with $3\\times 3$ and $2 \\times 2$ matrices \nwas written in assembly language, which again increased \nthe speed of the code essentially.\n\nHaving carried out lattice simulations for these two theories we \nobtained similar results for the speed of the\ncode and for the communication between nodes. \nThe MSSM results for communication are actually somewhat better. The reason\nfor that is quite simple. The number of variables in the MSSM\nis larger by a factor of two than in pure SU(3) gauge theory; \nhowever, the number of floating point operations \nneeded for a full update is more than an order of magnitude larger.\nThus, for the same lattice size the time needed to\ntransfer the surface variables --done by the\ncommunication cards-- compared to the update time\nis smaller for MSSM than for the pure SU(3) theory. \nWe expect that a similar though less pronounced effect \nshould be observed for fermionic systems e.g. \nwith multiboson \\cite{multiboson}\nalgorithms. \nSince it is much more straightforward to compare our SU(3) results \nthan those of the MSSM simulations with \nthe results of the literature, \nin the following paragraphs we discuss the SU(3) case, too. \n\nFor small lattice sizes the most economical way to use our\n32 PC cluster is to put independent lattices on the different\nnodes. The maximum lattice size in the SU(3) theory \nfor 128 Mbyte memory is $\\sim 20^4$,\nor for finite temperature systems $6 \\cdot 32^3$.\nOne thermalizes such a system on a single node, then distributes\nthe configuration to the other nodes and continues the\nupdating on all 32 nodes.\nWe measured the sustained performance of the cluster in this\ncase, which gave $32 \\times 152$Mflop=4.9Gflop. This\n152Mflop\/node performance means that one double precision operation is\ncarried out practically for every\nthird clock cycle of the 450 MHz,\nwhereas the nominal maximum of the \nprocessor is one operation for\nevery second clock cycle. As it was mentioned above, without assembly \nprogramming an approximate reduction factor of two \nin the performance was observed. \n\nIncreasing the volume of the simulated system one can divide\nthe lattice between 2 nodes (the $2\\times 4\\times 4$ topology\nhas 2 nodes in one of the directions). For even larger lattices\none can use 4 nodes (4 in one direction), 8 nodes\n($2\\times 4$ in two directions) 16 nodes ($4\\times 4$ in\ntwo directions) or 32 nodes ($2 \\times 4 \\times 4$ in three\ndirections). Again, the most economical way to perform the simulations\nis to prepare one thermalized configuration and put it on\nother nodes (this method obviously can not be used for the\n$2\\times 4\\times 4$ topology, because in this case the whole \nmachine with 32 nodes is just one lattice). \n\n\\begin{figure}\n\\centerline{\\epsfig{file=perform.eps,width=8cm}}\n\\caption[a]{Sustained performance of PMS as a function\nof the lattice volume for pure SU(3) gauge theory and for MSSM. \nThe endpoints of the lines correspond to the largest\nvolumes which can be simulated on a 32 PC cluster.\n\\label{perform}}\n\\end{figure}\n\nBased on our measurements we determined the sustained performance\nof a 32-node PMS cluster as a function of the lattice volume. The\nresult for a set of lattice volumes for finite temperature systems \nwith temporal extension,\n$L_t=6$ for SU(3) and $L_t=4$ for MSSM can be seen on Fig. \n\\ref{perform}. Clearly, the largest volume one can reach is approximately\ntwice as large for the SU(3) gauge theory than for the MSSM. \nFor both cases there are regions where the performance increases\nwith the volume. This can be easily explained by the fact that larger \nvolume means better surface\/volume ratio, thus better performance.\nThere are three drops in the performance for both SU(3) and MSSM. \nThey correspond to\nlattice volumes for which new communication directions were opened\n(or, in other words, the dimension of the mesh of the nodes on which the lattice\nwas divided, increased by one) in order to fit the lattice into the \navailable RAMs. As it can be seen the performance for the MSSM \nis still very high even at the largest volume with three-dimensional\ncommunication: it is just 10\\% smaller than the performance without\ncommunication. This plot gives us the optimum architecture of\nsuch a parallel computer. The number of nodes and the\nnumber of communication directions used for a given lattice \nshould be as small as possible simultaneously. \nThis means a $2\\times 4\\times 4$\ntopology for 32 nodes and a $2\\times 4\\times 8$ topology 64 nodes. \n\nDespite the fact that the speed of the communication between two nodes\nis not that high (2 Mbit\/sec) the performance of the cluster is quite good. The\nreason for this is the high speed of the individual nodes (450 MHz) and the\nlarge RAM on each node. This sort of design does not need a division of the\nlattice to hundreds of sub-lattices, thus it does not need a very fast\ncommunication. Clearly, the use of PCI communication instead of ISA\ngives an order of magnitude faster communication, which increases the\npotential of such a machine.\n\n\\begin{figure}\n\\centerline{\\epsfig{file=compare.eps,width=10cm,height=10cm}}\n\\vspace{-10cm}\n\\centerline{\\epsfig{file=compare2.eps,width=10cm}}\n\\caption[a]{Sustained performance of different machines\nused in lattice gauge theory as a function of price\/performance.\nOur PMS machine is presented as a 32 PC based system.\n\\label{compare}}\n\\end{figure}\n\nIn order to compare our machine with other existing (and proposed) \nparallel systems\nused in lattice gauge theory, we use the plot of N. Christ \\cite{christ}.\nAs it can be seen in Fig. \\ref{compare},\n PMS1 is perhaps the best existing machine \nas far as price\/sustained performance is concerned. \nIt is particularly important to emphasize \n that the presented performance 3\\$\/Mflop with $\\approx$4Gflop total \n performance of PMS1 is calculated\nfor double precision operations (while some of the performances of the \nmachines on the plot are given for single precision operations). \nFor single precision simulations one can use the MMX instruction set which is\n8 times faster than the double precision operations (4 operations for each\nclock cycle). We estimated the single precision performance by assuming that\nMMX programming results in 20\\% decrease in performance. The total performance\nof PMS1 is $\\approx$27Gflop with 0.45\\$\/Mflop price-to-sustained performance\nratio. (Notice that our measured performance is based on double precision\ncode, whereas single precision numbers are estimated ones.) \nOur PMS1 machine, similarly to other workstation farms has a moderate \nmaximum sustained\nperformance as compared to Teraflop-scale machines (CP-PACS \\cite{CP-PACS} or QCDSP \\cite{QCDSP}). \nHowever, PMS1 has a much better price\/performance ratio than other workstation\nfarms. The reason for this is threefold.\\\\\na. At the day of purchase our choice for the PC components was optimized \nfor price\/performance.\\\\\nb. Machines with 100Mbit fast Ethernet (e.g. Indiana) are inexpensive, but\ncommunication is slow, resulting in a high price\/performance ratio. \\\\\nc. Machines with much faster networks using Myrinet (e.g. Alice \\cite{alpha} \nand Altacluster)\ngive higher performance. However, this is balanced in the price\/performance\nratio by the higher cost of the network.\\\\\nThe essential feature of PMS architecture is that the speed of the \ncommunication (depending on the size of the machine) is comparable to that of\nMyrinet. However, the price for such a communication is as low as \n$\\approx$40\\$\/node, which is more than an order of magnitude less than the\ncost of Myrinet.\n\n\n\n\\section{Conclusion}\nWe have presented a description of the status of PMS project. Details of \nthe communication hardware and software have been explained. The existing \n32-node machine (PMS1) is able to perform medium size LGT simulations in case \nof nearest neighbour interactions, distributing the lattice on several nodes, \nif necessary. This is done at a very good price\/sustained performance ratio.\nProblems requiring more number crunching and less communication give a \nbetter performance. \n\nWe plan to increase the number of connected nodes and implement the PMS CH \nfor faster buses in order to increase the maximum size of programs and enhance\ncommunication speed.\n\nFinally, we would like to emphasize that the design of our communication hardware and the\ndeveloped Linux drivers are freely available for non-profit organizations.\nThose who intend to build a PMS architecture machine have simply to buy PCs \nproduce the communication cards and connect the nodes by flat cables.\nFurthermore they have to install Linux and our Linux driver.\nQuestions and requests for information should be sent to pms@labor.elte.hu.\n\n\n\\section{Acknowledgement}\nThis work was supported by Hungarian Science Foundation Grants under Contract\nNos. OTKA-T22929-T29803-F17310-M28413\/FKFP-0128\/1997.\n\n\n\\section{Appendix}\n\nThe following C code is a simple example to illustrate the usage of PMS\ncommunication cards in a given application. This example transfers random numbers\nin each direction. It can be used to test all channels. We performed\nthis test on all cards by sending 100 Gbytes of data on\neach channel. We observed no errors.\nThe header file 'pms.h' that contains the function prototypes\nis also included.\\\\\n\n\n\\baselineskip=-0.4truecm\n\\noindent\n\n{\\small\n\\begin{verbatim}\n#include\n#include\n#include\n#include\"pms.h\" \/* PMS function prototypes *\/\n#define MUL 1579 \/* Random number generator multiplier *\/\n#define N 1000 \/* Number of packages to transfer *\/\n#define K 16384 \/* Size of each package in words *\/\nunsigned short j_r=1, j_s=1; \/* initial values for random number generators *\/\n\nint send(int dir) {\nstatic unsigned short buf[K];\nint i,err;\n \n for (i=0; i0) {\n err=0;\n for (i=0; i 1D-\\n\"); \/* Test the first direction *\/\n if (!par) { \/* Priority check: even nodes send first, odd nodes *\/\n \/* receive first *\/\n if (send(0) <=0) printf(\"Send error\\n\");\n if (recv(1) !=0) printf(\"Recv error\\n\");\n } else {\n if (recv(1) !=0) printf(\"Recv error\\n\");\n if (send(0) <=0) printf(\"Send error\\n\");\n }\n\n printf(\"Testing 1D- -> 1D+\\n\"); \/* Test the second direction *\/\n if (!par) {\n if (send(1) <=0) printf(\"Send error\\n\");\n if (recv(0) !=0) printf(\"Recv error\\n\");\n } else {\n if (recv(0) !=0) printf(\"Recv error\\n\");\n if (send(1) <=0) printf(\"Send error\\n\");\n }\n printf(\"Testing 2D+ -> 2D-\\n\"); \/* Test the first direction *\/\n if (!par) {\n if (send(2) <=0) printf(\"Send error\\n\");\n if (recv(3) !=0) printf(\"Recv error\\n\");\n } else {\n if (recv(3) !=0) printf(\"Recv error\\n\");\n if (send(2) <=0) printf(\"Send error\\n\");\n }\n\n printf(\"Testing 2D- -> 2D+\\n\"); \/* Test the second direction *\/\n if (!par) {\n if (send(3) <=0) printf(\"Send error\\n\");\n if (recv(2) !=0) printf(\"Recv error\\n\");\n } else {\n if (recv(2) !=0) printf(\"Recv error\\n\");\n if (send(3) <=0) printf(\"Send error\\n\");\n }\n printf(\"Testing 3D+ -> 3D-\\n\"); \/* Test the first direction *\/\n if (!par) {\n if (send(4) <=0) printf(\"Send error\\n\");\n if (recv(5) !=0) printf(\"Recv error\\n\");\n } else {\n if (recv(5) !=0) printf(\"Recv error\\n\");\n if (send(4) <=0) printf(\"Send error\\n\");\n }\n\n printf(\"Testing 3D- -> 3D+\\n\"); \/* Test the second direction *\/\n if (!par) {\n if (send(5) <=0) printf(\"Send error\\n\");\n if (recv(4) !=0) printf(\"Recv error\\n\");\n } else {\n if (recv(4) !=0) printf(\"Recv error\\n\");\n if (send(5) <=0) printf(\"Send error\\n\");\n }\n pms_close(); \/* Close the card *\/\n}\/* end of main() *\/\n\/*********************************************\/\n\n(file: pms.h)\n\nextern int mynode;\nextern int node_par;\n\nint pms_open(void);\nvoid pms_close(void);\nint pms_send(void * buf, int count, int dir);\nint pms_recv(void * buf, int count, int dir);\n\n\n\\end{verbatim}\n\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\nA quantum walk (QW) is the quantum version of a classical random walk~\\cite{Aharonov1993PhysRevA,Kempe2003introductory}.\nDue to the principle of superposition in quantum mechanics, \na QW gives rise to impressive applications in quantum information science, from quantum computing~\\cite{LCE+10,Childs2009PhysRevLett,Childs2013Science,Childs2004PhysRevA} to quantum simulation~\\cite{Schreiber2012Science2DQW}, and from implementing quantum measurement~\\cite{Kurzy2013PhysRevLettGeneralizedMeasuring,Bian2015PhysRevLettPOVM,Zhao2015PhysRevA} \nto exploring topological phases~\\cite{Kitagawa2010PhysRevAExploring,2012PhysRevB,Kitagawa2012Observation,xiao2017observation,Wang2018PhysRevA,Wang2019PhysRevLett,Xu2019PhysRevResearch,WZS19}.\nFor the discrete-time QW~(DTQW), entanglement can be generated between coin~(c) and walker~(w) position degrees of freedom of the walker~\\cite{Carneiro2005Entanglement}, which is a key resource for quantum information processing~\\cite{Horodecki2009RevModPhys}. Particularly, qubit-qudit entanglement generated in DTQW provides richer contents beyond qubit-qubit entanglement, such as nonlocality~\\cite{Lee2007PhysRevA,Li2015SR}, entanglement detection~\\cite{Zhao2011PhysRevA_Endetection,Chen2012PhysRevA,Shen2020PhysRevA}, entanglement of formation~\\cite{Gerjuoy2003PhysRevA, Chen2005PhysRevLett,Lastra2012PhysRevA}, survival of entanglement~\\cite{Dajka2008PhysRevA,Giordani2021NJP}, separability~\\cite{Johnston2013PhysRevA,Ha2005PhysRevA}, steering~\\cite{Chen2018PhysRevA}, concurrence~\\cite{Chen2005PhysRevLett,Zhao2011PhysRevA,Mintert2004PhysRevLett} and discord~\\cite{Sai2012,Girolami2012PhysRevLett,Ma2015SR}.\nThe DTQW is particularly valuable for maximal entanglement generation \n(MEG),\nand our goal is guaranteed MEG after just a few steps. \n\nIn a dimensional (1D) DTQW with static coin operations (unchanging coin operation during evolution), \nentanglement generation depends on the initial coin state and cannot reach a maximal value~\\cite{Abal2006PhysRevA}.\nCounterintuitively, by introducing disorder into the DTQW~\\cite{Chandrashekar2013ArXiv}, e.g., randomly choosing SU(2) coin operation\n\\begin{equation*}\n\\hat{C}(\\xi,\\gamma,\\zeta)\n=\\begin{pmatrix}\\text{e}^{\\text{i}\\xi}\\cos\\gamma&\\text{e}^{\\text{i}\\zeta}\\sin\\gamma\\\\\\text{e}^{-i\\zeta}\\sin\\gamma&-\\text{e}^{-i\\xi}\\cos\\gamma\\end{pmatrix},\n4\\gamma,\\xi,\\zeta\\in[0, 2\\pi],\n\\end{equation*}\nat each step,\ngenerated entanglement is significantly enhanced and achieves MEG asymptotically\nindependent of initial conditions~\\cite{Vieira2013PhysRevLett,Vieira2014PhysRevA}. \nMotivated by robust entanglement generation under experimental conditions with imperfections and disorder,\nrandom-coin DTQWs have been studied for various disorder configurations~\\cite{Zeng2017,Orthey2019,Pires2021,Laneve2021PhysRevResearch}\nand been observed experimentally in a 20-step optical network~\\cite{Wang2018Optica}.\n\nThe main obstacle to utilizing a disordered DTQW for MEG is that many steps are required to reach asymptotic maximal entanglement~\\cite{Vieira2013PhysRevLett}, which is problematic for current experimental technologies.\nAlternative strategies in optimising\ncoin-operation sequence during the evolution have been proposed aiming at MEG for few steps. Universal and optimal coin sequences are proposed to generated highly entangled states for fewer than $10$ steps~\\cite{Gratsea_2020_Universal_optimal_coinSequences,Gratsea_2020_Generation_of_hybrid}. However, the universal sequence works for an odd number of steps and for the states with vanishing relative phase,\nwhereas the optimal sequence depends on the initial coin states.\nParrondo sequences have been proposed to generate maximal entanglement at steps $T=3$ and $T=5$, \nwith the expectation that many steps are needed to for MEG~\\cite{govind2020generating}. \nRecently, MEG has been realized with a position-inhomogeneous quantum walk~\\cite{Zhang2022PRA}.\nIdeal MEG via a DTQW should work for any step number \\emph{and} independent of initial conditions,\nbut previous experiments only achieve either one or the other, not both;\nwe achieve both simultaneously here\nfor all steps beyond the second\nby solving an optimisation problem.\nExperimentally, we demonstrate the DTQW with requisite coin sequences up to 10 steps with linear optics\nand observe significant enhancement of entanglement generation compared to other entanglement-generation schemes.\n\\begin{figure*}[ht!\n \t\\includegraphics[width=\\linewidth]{Fig1_V5} \n \t\\caption{(a) The geometric representation of the optimal coin sequence $\\mathrm{C}_T$ that can generate maximal entanglement irrelevant of initial state $\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}$. (b) Results of maximal $\\mathcal F_{\\mathrm{C}_T}$ with coin set $\\{\\hat{C}(\\gamma_1), \\hat{C}(\\gamma_2)\\}$ at $T=5$, $T=10$ and $T=20$. (c) The maximal $\\mathcal F_{\\mathrm{C}_T}$ in QW with five different coin sets from $T\\in[20]$.\n \t(d) 50 optimized~$\\bm b$ at $T=20$ with coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ where 0 represents $\\hat{H}$ and 1 represents $\\hat{\\mathds1}\\}$.} \n \t\\label{Fig:conceptandoptimazation}\n \\end{figure*}\n \nThe 1D DTQW coin-walker Hilbert space is $\\mathscr{H}\n =\\mathscr{H}_\\text{c}\\otimes\\mathscr{H}_\\text{w}$\nwith\n\\begin{equation}\n\\label{eq:Hcw}\n \\mathscr{H}_\\text{c}=\\text{span}\\{\\ket0_\\text{c},\\ket1_\\text{c}\\},\\,\n \\mathscr{H}_\\text{w}=\\text{span}\\{\\ket{x};\nx \\in \\mathbb{Z}\\}\n\\end{equation}\nThe walker is initially localized position,\n$\\ket0_\\text{w}$,\nwith arbitrary initial coin \n$\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}=\\cos(\\nicefrac\\theta2)\\ket0_\\text{c}+\\text{e}^{\\text{i}\\phi}\\sin(\\nicefrac\\theta2)\\ket1_\\text{c}$,\nwhere $2\\theta,\\phi \\in [0,2\\pi]$. At step~$t$, coin operator $\\hat{C}_t$ is applied.\nThen the walker moves left or right entangled with the coin\nrepresented by the conditional shift operator\n\\begin{equation}\n\\label{eq:shiftoperator}\n\\hat{S}=\\ket0_\\text{c}\\bra{0}\\otimes\\sum_{x}\\ket{x+1}_\\text{w}\\bra{x}+\\ket1_\\text{c}\\bra{1}\\otimes\\sum_x\\ket{x-1}_\\text{w}\\bra{x},\n\\end{equation}\nwhich is independent of~$t$.\n\nFor $t\\in[N]:=\\{1,\\ldots,N\\}$,\nthe evolution is\n\\begin{equation}\n\\label{eq:evolution}\n\\ket{\\theta,\\phi}_{\\text{f}}\n=\\prod_{t\\in[T]}\\hat{U}_t\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}\\otimes\\ket0_\\text{w},\\,\n\\hat{U}_t=\\hat{S}(\\hat{C}_t\\otimes\\hat{\\mathds1}_\\text{w}),\n\\end{equation}\nfor $\\hat{\\mathds1}_\\text{w}=\\sum_{x}\\ket{x}\\bra{x}$\nthe identity operator on $\\mathscr{H}_\\text{w}$,\nand~f short for `final'.\nThe sequence\n$\\bm{C}_T:=\\left(\\hat{C}_t\\right)_{t\\in[T]}$\ndescribes coin operations applied to the walker.\nAs varying coin parameters~$\\xi$ and~$\\zeta$ is equivalent to varying~$\\phi$ of initial state\n$\\ket{\\theta,\\phi}_\\text{in}$~\\cite{Bach2004}, \nwe replace\n$\\hat{C}(\\gamma)\\gets\\hat{C}(0,\\gamma,0)$.\nFurthermore, we restrict construction of~$\\bm{C}_T$\nby allowing only two coin operations:\n$\\gamma_{0,1}$\nlabelled by one bit with values~0 and~1.\nThe sequence~$\\bm{C}_T$ is then expressed as a bit string $\\bm b\\in\\{0,1\\}^T$ of length~$T$ with~$0$ labelling~$C(\\gamma_0)$ and~$1$ labelling~$C(\\gamma_1)$.\n\nAchieving walker-coin MEG at step~$T$ regardless of $\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}$ corresponds to designing $\\bm{C}_T$ that maps any $\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}\\otimes\\ket0_\\text{w}$ to maximally entangled walker-coin state $\\ket{\\theta,\\phi}_{\\text{f}}$.\nEntanglement of $\\ket{\\theta,\\phi}_{\\text{f}}$ \nis quantified by entropy\n\\begin{equation}\n\\mathcal S_{\\text{E}}(\\ket{\\theta,\\phi}_\\text{f})\n=-{\\rm tr}\\left(\\rho_\\text{c}^{\\text{f}} \\log_2 \\rho_\\text{c}^{\\text{f}}\\right)\n=-\\sum_{\\varepsilon\\in\\pm}\n\\lambda_\n\\varepsilon\\log_2\\lambda_\\varepsilon,\n\\label{Eq:vonneumannentropy}\n\\end{equation} \nof the reduced coin state~\\cite{Abal2006PhysRevA,Bennett1996PhysRevA}\n$\\rho_\\text{c}^{\\text{f}}:={\\rm tr}_\\text{w}(\\ket{\\theta,\\phi}_\\text{f}\\bra{\\theta,\\phi})$ and $\\lambda_{\\pm}$ are the eigenvalues of $\\rho_\\text{c}^{\\text{f}}$.\nNote that $0\\leq \\mathcal S_{\\text{E}}\\leq 1$, and $\\mathcal S_{\\text{E}}\\equiv0$ for separable states and~1 for maximally entangled states.\n\nThus, MEG evolution~(\\ref{eq:evolution}) yields maximally entangled $\\ket{\\theta,\\phi}_{\\text{f}}$,\nwhich is equivalent to $\\mathcal E_{\\bm{C}_T}(\\rho_\\text{c}^{\\text{in}}=\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}\\bra{\\theta,\\phi})=\\nicefrac{\\mathds1}{2}$ in~$\\mathscr{H}_\\text{c}$, where $\\mathcal E_{\\bm{C}_T}$ is a completely-positive linear map determined by $\\bm{C}_T$.\nA geometric illustration of~$\\mathcal E_{\\bm{C}_T}$ for MEG\nis in~\\cref{Fig:conceptandoptimazation}(a), which is the depolarizing channel $\\mathcal E^{\\text{DP}}(\\rho_\\text{c}^{\\text{in}})=(1-\\eta)\\rho_\\text{c}^{\\text{in}}+\\eta\\nicefrac{\\mathds1}{2}$ with $\\eta=1$~\\cite{Nielsen2011Quantum}.\nProcess fidelity\n$\\mathcal F_{\\bm{C}_T}\n:={\\rm tr}\\left(\\sqrt{\\chi_{\\bm{C}_T}}\\chi_{\\text{DP}}\\sqrt{\\chi_{\\bm{C}_T}}\\right)^2$,\nis our figure of merit to design $\\bm{C}_T$,\nwhere $\\chi_{\\bm{C}_T}$ is the Pauli-matrix representation of quantum channel $\\mathcal E_{\\bm{C}_T}$.\nNote that $\\mathcal F_{\\bm{C}_T}=1$ indicates MEG at step~$T$ regardless of $\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}$, and we refer to the corresponding coin sequence $\\bm{C}_T$ as the \\emph{optimal} coin sequence.\n\n\\begin{figure*}[htb\n \t\\includegraphics[width=\\linewidth]{Fig2_V4} \n \t\\caption{(a) Detailed sketch of the setup to realize the 10-step DTQW. (b) Coin operations realized in experiment. A half-wave plate~(HWP) set at 22.5$^\\circ$ corresponds to operation $\\hat{H}$ and a quarter-wave plate~(QWP) set at 45$^\\circ$ corresponds to operation $\\hat{F}$. No waveplate needs to be arranged if the operation is $\\hat{\\mathds1}$. (c) Symbols used in (a) and (b): periodically poled potassium titanyl phosphate (PPKTP), polarization beam splitter (PBS), half-wave plate (HWP), quarter-wave plate (QWP), beam displacer (BD), single photon detector (SPD).} \n \t\\label{Fig:Setup}\n \\end{figure*} \n\n\nThree parameters determine~$\\bm{C}_T$: $\\gamma_{0,1}$ and corresponding~$\\bm b$.\nWe address designing optimal $\\bm{C}_T$ as an optimisation problem.\nFor fixed~$T$, optimizing~$\\bm b$\nand~$\\gamma_{0,1}$\nis achieved by minimising the cost function $1-\\mathcal F_{\\bm{C}_T}$,\nin our case using an annealing algorithm.\nResults of optimisation of $\\gamma_{0,1}$\nat $T\\in\\{5,10,20\\}$\nare shown in~\\cref{Fig:conceptandoptimazation}(b) ($\\bm b$ is not shown here).\nEvidently,\nthe minimal $1-\\mathcal F_{\\bm{C}_T}$\nis obtained for two coin sets:\n$\\{\\hat{C}(0), \\hat{C}(\\nicefrac{\\pi}4)\\}$ and $\\{\\hat{C}(\\nicefrac{\\pi}2), \\hat{C}(\\nicefrac{\\pi}4)\\}$. Note that $\\hat{C}(0)=\\hat{\\sigma}_z$, $\\hat{C}(\\nicefrac{\\pi}4)=\\hat{H}$ and $\\hat{C}(\\nicefrac{\\pi}2)=\\hat{\\sigma}_x$.\nThe evolution unitary operator with coin operator $\\hat{\\sigma}_z$, i.e., $\\hat{U}=\\hat{S}\\hat{\\sigma}_z$,\nmakes the components~$\\ket0_\\text{c}$ and~$\\ket1_\\text{c}$ propagate in the opposite direction without interference, which has the similar effect of $\\hat{U}=\\hat{S}\\hat{\\mathds1}$ with identity operator $\\hat{\\mathds1}$ yielding a phase $\\text{e}^{\\text{i}\\pi}$ on component~$\\ket1_\\text{c}$.\n\nWe conjecture that the coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ with optimized~$\\bm b$ leads to MGE as well.\nAlong this spirit, we fix $T$ and coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$\nand optimize~$\\bm b$ with cost function $1-\\mathcal F_{\\bm{C}_T}$. The results of $\\mathcal F_{\\bm{C}_T}$ with~$T$ up to~20 are shown with blue dots in~\\cref{Fig:conceptandoptimazation}(c), in which we observe that $\\mathcal F_{\\bm{C}_T}=1$ since step $T=3$.\nTo give a comparison, we also show the maximum $\\mathcal F_{\\bm{C}_T}$ over $2^T$ possible~$\\bm b$ with coin sets\n$\\{\\hat{H}, \\hat{\\sigma}_z\\}$, $\\{\\hat{H}, \\hat{\\sigma}_x\\}$, $\\{\\hat{H}, \\hat{F}\\}$ and $\\{\\hat{H}\\}$,\nwhere $\\hat{F}=[1,\\text{i};\\text{i}, 1]\/\\sqrt{2}$. The results with coin set $\\{\\hat{H}, \\hat{\\sigma}_z\\}$ is as same as that with $\\{\\hat{H}, \\hat{\\mathds1}\\}$. For the coin set $\\{\\hat{H}, \\hat{\\sigma}_x\\}$, $\\mathcal F_{\\bm{C}_T}=1$ is achieved at step $T=5$ and $T\\geq 7$.\nAsymptomatic behavior is observed with coin set $\\{\\hat{H}, \\hat{F}\\}$ and oscillating behavior is observed in Hadamard walk. \n\n\n\nWe note that optimal~$\\bm b$ at step~$T$ is not unique.\nFor instance, we obtain 1104 optimal~$\\bm b$ at $T=20$,\nand we list 50 among them in~\\cref{Fig:conceptandoptimazation}(d).\nThere are no obvious features of regularities and generalities of these optimal~$\\bm b$.\nAn optimal~$\\bm b$ containing~0 ($\\hat{H}$) as less as possible is preferred in experiment, so we choose the optimal~$\\bm b$ containing one~0 or two~0s in our realization ( The explicit form of $\\bm b$ and its corresponding proof are in~\\cref{App:optimalsequence} ).\n\\begin{figure*}[ht!bp\n \\includegraphics[width=\\linewidth]{Fig3_V3}\n\\caption{%\n(a) Experimental results of $\\mathcal F_{\\bm{C}_T}$\n with coin sets $\\{\\hat{H}, \\hat{\\mathds1}\\}$, $\\{\\hat{H},\\hat{F}\\}$ and $\\{\\hat{H}\\}$ at $T=2$ to $T=10$.\n(b) Average entanglement $\\langle\\mathcal{S}_\\text{E}\\rangle$\nover 296 initial coin states with the reconstructed\n$\\chi^\\text{exp}_{\\bm{C}_T}$.\n(c) Results of Geometric representation of reconstructed $\\chi^{\\text{exp}}_{\\bm{C}_T}$ with coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ at $T=4,6,8$ and $10$.\n(d) Geometric representation of reconstructed $\\chi^{\\text{exp}}_{\\bm{C}_T}$\nwith coin set\n$\\{\\hat{H},\\hat{F}\\}$\nat $T=4,6,8$ and $10$.}\n\\label{Fig:Geometricplot}\n\\end{figure*}\n\nThe experimental setup to implement 1D DTQW is shown in~\\cref{Fig:Setup}(a). The coin state is encoded in the photon's polarization degree of freedom by $\\ket{H(V)}=\\ket{0(1)}$, where $\\ket{H(V)}$ denotes the horizontal (vertical) polarization.\nThe position state is encoded in the photon's spatial degree of freedom, i.e., the longitudinal spatial modes.\nTwo photons in state $\\ket{H}\\ket{V}$ with central wavelength at 810~nm are generated from a periodically poled potassium titanyl phosphate (PPKTP) crystal pumped by an ultraviolet CW laser diode with the central wavelength at 405~nm. The two photons are then separated by a polarizing beam splitter (PBS), which transmits the horizontal polarization and reflects vertical polarization.\nThe reflected photon is detected by single-photon detector (SPD) to serve as a trigger. The transmitted photon is sent into the photonic network consisting of waveplates and birefringent calcite beam displacers (BDs), in which the longitudinal spatial mode of injected photon is denoted as the start position of the walker $\\ket0_\\text{w}$. The coin operations $\\hat{C}_t$ are realized by waveplates which rotates the polarization of photon, and the BD transmits the vertical polarization while deviating from the horizontal polarization so that BD acts as shift operation $\\hat{S}$. \n\n\n\nTo reconstruct the process matrix $\\chi^{\\text{exp}}_{\\bm{C}_T}$,\nwe prepare four states as initial coin states $\\ket{\\theta,\\phi}_\\text{c}^{\\text{in}}$, i.e., $\\ket{H}$, $\\ket{V}$, $\\ket{+}$ and $\\ket{L}$. For each step~$t$, we set the the optimal coin sequence $\\bm{C}_T$ accordingly, and reconstruct $\\rho_\\text{c}^{\\text{f}}$ using quantum state tomographic technology~\\cite{Nielsen2011Quantum}. The experimental results of $\\mathcal F_{\\bm{C}_T}$ with coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ are shown with blue circles in~\\cref{Fig:Geometricplot}(a).\nWe observe that the average $\\mathcal F_{\\bm{C}_T}$ from $T=3$ to $T=10$ is $0.9954\\pm0.0008$, which is much better than the results with coin set $\\{\\hat{H}, \\hat{F}\\}$ as shown with red squares. \nFor the Hadamard QW, $\\mathcal F_{\\bm{C}_T}<0.8$\nand oscillates as~$T$ increases (shown with yellow triangles). We calculate the average entanglement $\\langle\\mathcal{S}_\\text{E}\\rangle$ over 296 initial coin states with the reconstructed $\\chi^\\text{exp}_{\\bm{C}_T}$, and the results are shown in~\\cref{Fig:Geometricplot}(b). The error bar indicates initial-state-independence, and we observe a stronger initial-state-independence with coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ than the other two. This is also reflected by the geometric interpretations of $\\mathcal F_{\\bm{C}_T}$ as shown in~\\cref{Fig:Geometricplot}(c) (coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$) and~\\cref{Fig:Geometricplot}(d) (coin set $\\{\\hat{H}, \\hat{F}\\}$) at $T=4, 6, 8$ and $10$, respectively. It is obviously that the results with $\\{\\hat{H}, \\hat{\\mathds1}\\}$ is much more dense than that with $\\{\\hat{H}, \\hat{F}\\}$, which indicates the entanglement generation with coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ has stronger independence of initial coin states than that with the other two. More details are shown in~\\cref{App:processodd}. \n\nBesides $\\mathcal F_{\\bm{C}_T}$, we investigate spreading over the walker Hilbert space $\\mathscr{H}_\\text{w}$. \nSpread of the probability distribution $\\mathcal P(x, T)$ can be characterized by the normalized Shannon entropy \n\\begin{equation}\n\\mathcal S_\\text{S}(T)=\\frac{-\\sum_x \\mathcal P(x, T) \\ln\\mathcal P(x, T)}{\\ln(T+1)}, \n\\end{equation} \nwith $\\frac1{\\ln(T+1)}$ the normalisation parameter.\nThe walker is able to occupy $T+1$ positions after~$t$ steps so that the maximal value of $-\\sum_x \\mathcal P(x, T) \\ln\\mathcal P(x, T)$ is $\\ln (T+1)$, which corresponds to the uniform distribution over $T+1$ positions~\\cite{2020_martin-vazquez_Phys.Rev.A_Optimizing}.\nLarger $\\mathcal S_\\text{S}(T)$ implies $\\mathcal P(x, T)$ is more uniform. For a $T$-step QW associated with corresponding optimal $\\bm{C}_T$, we measure the probability distribution $\\mathcal P(x,T)$ at step~$T$, according to which we calculate the normalized Shannon's entropy $\\mathcal S_\\text{S}(T)$. The results of $\\mathcal P(x,T)$ with initial coin state $\\ket{H}$ and $\\ket{L}$ are shown in~\\cref{Fig:spread}(a,c), and the corresponding $\\mathcal S_\\text{S}(T)$ are shown in~\\cref{Fig:spread}(b,d) respectively. Compared with the other two cases, the uniformity of QW with coin set $\\{\\hat{H}, \\hat{\\mathds1}\\}$ shows enhancement at $T=3$ and $T=7$. We also analyze the trend of probability distributions with different coin sets. More experimental results and analysis can be found in~\\cref{App:transport}. \n\n\\begin{figure*}[htbp\n\\includegraphics[width=\\linewidth]{Fig4_V5} \n\\caption{%\nMeasured $\\mathcal P(x,T)$ with initial coin state (a) $\\ket{H}$ and (c) $\\ket{L}$, according to which the calculated $\\mathcal S_\\text{S}(T)$ are shown in (b) and (d), respectively. } \n\\label{Fig:spread}\n\\end{figure*}\n\nIn conclusion, we design coin sequences that can rigorously generate maximal entanglement between coin and her walker in 1D DTQW with three key features, that are: to be available at any $T\\geq3$, to be independent of initial coin state and to be the simplest for experimental implementation. A comparison of our coin sequence~$\\bm{C}_T$ with the other coin sequences is shown in~\\cref{App:comparison}, and MEG with our coin sequence significantly outperforms all other proposed coin sequences in three features mentioned above.\n\nExperimentally, we realize a 10-step 1D DTQW with an optical network, and observe the MEG with with our proposed coin sequence as well as other coin sequences. The results show a significant enhancement of MEG with our coin sequences, which benefits the intermediate quantum information processing that requires maximal qubit-qudit entanglement. \nMoreover, for few steps, the spread of probability distributions with our coin sequence is more uniform, which is favorable and useful in various quantum algorithms and quantum simulation of biological processes~\\cite{2003_kendon_Phys.Rev.A_Decoherence,2007_maloyer_NewJ.Phys._Decoherence,2020_martin-vazquez_Phys.Rev.A_Optimizing}. Our protocol can also be generalized to $p$-diluted disorder QW~\\cite{Geraldi2019PhysRevLett,Geraldi2021PhysRevResearch}, in which transport behavior can be engineered by controlling probability of coin operations. \n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\nWith the advent of Internet of Things (IoT), multi-sensor systems have become increasingly ubiquitous. They are used to make control decisions in systems ranging from smart homes to vehicular networks. Sensors in these systems measure time varying quantities and communicate with a central monitoring station. It is crucial that the monitoring station receives timely updates from the sensors to make critical decisions. \n\nIn this work, we consider \\textit{n} sensors that measure real time updates and update a monitoring station through a shared unreliable communication channel. We divide time into slots and model the channels as ON-OFF channels that have independent realizations across sensors and time slots. At most one sensor is allowed to be scheduled in each time slot under the constraints of the scheduling problem. The goal is to design a scheduling policy that optimizes a freshness objective and hence reduces the staleness in information.\n\n\\textit{Age of Information} (AoI) has emerged as a popular metric to measure freshness of information at a destination and is defined as the time elapsed since the last update from a source. It grows linearly with time and resets to zero when an update is received from a source. AoI minimization has been studied extensively for scheduling applications in \\cite{7492912}-\\cite{8514816}. \nIn a multi-sensor setting with a shared channel, the AoI of a sensor increases due to two reasons. The first is when an attempted update by a sensor fails due to poor channel conditions and the second is when the shared channel is used by some other sensor. The original AoI metric does not distinguish between these two events. It is evident that the first event is fundamental and is caused by the physics of the problem and the second event is a resource allocation issue and therefore, controllable by the algorithm designer. Given this, we propose a variant of the AoI which distinguishes between these two events by imposing a penalty by increasing the ``age\" of the information of a sensor at the monitoring station only in the latter case. We refer to this metric as the \\textit{Channel-Aware Age of Information} (CA-AoI) and by definition, the CA-AoI of a sensor is a measure of the number of missed opportunities to send an update since its recent most successful update.\n\n The goal of our work is to design scheduling policies to minimize the time-average of the weighted sum of CA-AoIs of the sensors. Another important issue with AoI is that it grows to infinity as the channel conditions of a sensor become poor irrespective of the scheduling policy employed. The following example highlights the difference in schedules designed to minimize the time-average of the sum of the AoIs vs. the CA-AoIs. Consider a two sensor system with equal weights such that the first sensor has near reliable channel conditions and the second sensor has an extremely poor channel connection. On average, the AoI of the second sensor will be higher than the AoI of the first sensor irrespective of the fraction of times it is scheduled for transmission. As a result, a scheduling algorithm designed to optimize for AoI will attempt to schedule the second sensor at a higher rate in spite of the system conditions limiting its communication capacity. Similarly, the throughput achieved in a collection of sensors that aim at capturing the same physical process albeit with some diversity in measurements, will be low due to the disproportionate amount of resources allocated to the sensors with poor channel conditions. On the other hand, CA-AoI shrinks to zero as the channel conditions deteriorate and the resource allocation will thus be fairer across the sensors. However, using a scheduling policy that blindly maximizes the throughput will be unable to meet the timeliness requirements of the system. As we discuss ahead in Section \\ref{sec:discuss}, a scheduling algorithm designed to optimize for CA-AoI will be better suited to balance throughput and freshness compared to AoI. \n\n\n\nOptimizing this objective has several challenging aspects. For most sources the channel state information (CSI) is unknown. Hence the scheduler needs to guess when the channel state is ON so that the source can push an update. On the other hand, for some sources CSI is known before every time-slot. But even with CSI, designing a scheduling policy is highly nontrivial because the scheduler is allowed to schedule only a single source in every time slot. Computing the optimal policy using dynamic programming is difficult for such problems as the state-space grows exponentially with the number of sources. Hence low complexity policies are required that can make this constrained scheduling problem computationally efficient. \n\n\\begin{figure}[t]\n\\centering\n \\includegraphics[scale = 0.40]{Figures\/PS.pdf}\n \\caption{A multi-source system consisting of $n$ sensors communicating with a central monitoring station via unreliable communication channels. $p_{i}$ denotes the channel ON probabilities. }\n \\label{fig:PS}\n\\end{figure}\n\n\\subsection{Our Contributions}\n \nWe consider three cases, namely, systems without CSI, systems with CSI, and systems with partial CSI. \n \\begin{itemize}\n \\item[--] We propose a new AoI-like freshness metric called Channel Aware-Age of Information (CA-AoI). Unlike vanilla AoI, CA-AoI is not agnostic of channel reliability. \n \\item[--] We derive universal lower bounds on the average weighted sum of CA-AoI for different CSI models. \n \\item[--] We view the scheduling problem through the lens of a restless multi-armed bandit framework (RMAB) and prove that all three problem instances are indexable. We derive structural properties for the optimal policy. Therefore we calculate closed form expressions for the Whittle index and propose low complexity scheduling algorithms. \n \\item[--] We propose a suite of stationary randomized scheduling algorithms to optimize the objective for all three problem instances. We find closed form expressions for the cost under these policies and thus optimal parameters for the algorithms. \n \\item[--] We compare the performance of the Whittle index and randomized policies against the greedy policy via simulations. We show the efficacy of our scheduling algorithms and conclude the superiority of the Whittle index policy in diverse settings.\n \\item[--] We finally demonstrate the advantage of using the sum of CA-AoIs over the sum of AoIs as the freshness metric in handling the diversity-throughput trade off. \n \\end{itemize}\n\n\\subsection{Related Work}\n\nAs mentioned above, there exists a rich body of work that uses AoI minimization in scheduling applications \\cite{7492912}-\\cite{8514816}. Several existing works model the scheduling problem as restless bandits and use Whittle index policies to solve them. The work in \\cite{9027444} derives the Whittle index for AoI minimization in a system having iid\/Markovian channels and multiple information settings (without CSI\/ with CSI\/ delayed CSI). In \\cite{article}, the authors use Whittle's methodology for the setting where realization of the stochastic arrival process for a given time-slot is known apriori. In \\cite{8486307}, the focus is on designing Whittle index policies for AoI minimization when the system has throughput constraints. In \\cite{8919842}, the authors consider Whittle index policies to minimize non-decreasing functions of AoI and prove optimality of the index policy for a system with 2 sources and reliable channels. Moreover in \\cite{8514816}, a lower bound for the sum of AoIs metric is derived and various low complexity algorithms with theoretical guarantees are designed. Very recently in \\cite{NIPS2019_8348}, the authors focus on scheduling a web engine under bandwidth constraints to track content changes in sources with different observabilities and propose randomized algorithms to optimize a harmonic freshness objective. \n\n\\section{Setting}\n We consider a system of \\textit{n} sensors, each communicating with a central monitoring station via a shared unreliable communication channel. Each sensor measures a time varying quantity and can push real time updates to the central monitoring station. \n \n \\subsection{Communication Model}\n Time is divided into slots. In a time slot, a maximum of a single sensor can push updates to the monitoring station. Here the sensors are assumed to be active sources and can thus generate updates in every time slot. \n\\subsection{Channel Model}\nWe model the channels as ON-OFF channels with channel ON probability for channel $i$ denoted as $p_{i}$. Here we assume that channel realizations are independent across sensors, and independent and\nidentically distributed (i.i.d.) over time-slots. \n\n\\subsection{Channel State Information (CSI) Models}\nWe consider the following three cases:\n\\begin{enumerate}\n \\item[--] \\emph{Systems without CSI}: In this case, the state of the channels for the various sensors (ON\/OFF) in a time-slot is not known to the scheduler before making the scheduling decision for that time-slot. \n \\item[--] \\emph{Systems with CSI}: In this case, the state of the channels for the various sensors (ON\/OFF) in a time-slot is known to the scheduler before making the scheduling decision for that time-slot.\n \\item[--] \\emph{Systems with partial CSI}: In this case, the state of the channels for some (a fixed subset) of the sensors is known to the scheduler before making the scheduling decision for that time-slot.\n\\end{enumerate}\nIn all three cases, channel statistics are known to the scheduler.\n\\subsection{Our Metric: Channel-Aware Age of Information (CA-AoI)}\n\nLet $X_{i}(t)$ denote the CA-AoI of sensor $i$ at time $t$. We denote the channel state at time $t$ with respect to sensor $i$ as $\\Lambda_{i}(t)$, where $\\Lambda_{i}(t)$ = 1 means that the channel is ON and $\\Lambda_{i}(t)$ = 0 implies that the channel is OFF. We indicate the action taken for sensor $i$ with $a_{i}(t)$, where $a_{i}(t)$ = 1 means that sensor $i$ is scheduled as time $t$ and $a_{i}(t)$ = 0 otherwise. Given the above definitions, CA-AoI for a sensor evolves as follows:\n\\begin{align*}\nX_{i}(t+1) = \\begin{cases}\n0, & \\text{if } a_{i}(t) = 1 \\text{ and } \\Lambda_{i}(t) = 1,\\\\\nX_{i}(t)+1, & \\text{if } a_{i}(t) = 0 \\text{ and } \\Lambda_{i}(t) = 1, \\\\\nX_{i}(t), & \\text{otherwise}.\n\\end{cases}\n\\end{align*}\nNote that as opposed to the vanilla AoI metric, CA-AoI doesn't penalize the age of a sensor if the channel is OFF at time $t$. In other words the age of a sensor is incremented only when the channel is in the ON-state and the sensor isn't scheduled.\n\n\\subsection{Objective}\nThe objective of the scheduling policy $\\pi$ is to minimize the time average of the weighted sum of CA-AoI:\n\\begin{gather}\n \\text{minimize }J^{\\pi} = \\limsup\\limits_{T\\rightarrow \\infty} \\frac{1}{T} \\mathbb{E}_{\\pi} \\left[\\sum_{t=1}^{T}\\sum_{i=1}^{n} w_{i}X_{i}(t) \\right], \\label{eq:1}\n \\\\\n \\text{subject to } a_{i}(t) \\in \\{0,1\\} \\ \\forall i, \\sum_{i=1}^{n} a_{i}(t) \\leq 1. \\nonumber\n\\end{gather}\nIn \\eqref{eq:1}, $w_{i}$ denotes the weight assigned to sensor $i$ and $\\mathbb{E}_{\\pi}$ denotes the expected weighted sum of CA-AoIs when a policy $\\pi$ is used.\n\n\n\n\\section{Main results and discussion}\n\nWe discuss our key results here. All proofs are provided in the Appendix. We first focus on deriving universal lower bounds for the freshness objective $J^{\\pi}$ . \n\n\\subsection{Universal Lower Bounds}\n\n\\begin{definition}(Admissible Policies $\\Pi$)\nIn an infinite horizon setting $T\\rightarrow \\infty$, the class of admissible policies $\\Pi$ omits all those policies that stop scheduling a particular sensor after a time slot $T' < \\infty$ with a positive probability.\n\\end{definition}\nOur first result characterizes a lower bound on the solution of $J^{\\pi}$ for a system without CSI among the class of admissible policies $\\Pi$. We denote the set of sensors in this system by $n^{-}$.\n\\begin{theorem}\n\\label{theorem:lower_bound_ucsi}\nFor a system without CSI, $J^{\\pi^{-}} \\geq \\mathcal{L}^{-}\\quad \\forall \\pi^{-} \\in \\Pi$ where\n\n\\begin{equation}\n \\mathcal{L}^{-} = \\frac{(\\Sigma_{i \\in n^{-}} \\:\\sqrt{w_{i}p_{i}})^{2} - \\Sigma_{i \\in n^{-}} w_{i}p_{i} }{2} \\nonumber\n\\end{equation}\n\\end{theorem}\n\nThe proof of Theorem \\ref{theorem:lower_bound_ucsi} can be found in Appendix \\ref{appe:lower_bound_ucsi}. The proof follows a sample path argument and uses Fatou's lemma and is derived from the technique in \\cite{8514816} used to find a lower bound for the AoI objective. \n\nIn the next result we derive the lower bound on $J^{\\pi}$ for a system with CSI having a set of sensors $n^{+}$, among the class of admissible policies $\\Pi$. \n\n\\begin{theorem}\n\\label{theorem:lower_bound_csi}\nFor a system with CSI, $J^{\\pi^{+}} \\geq \\max\\left(0,\\mathcal{L}^{+}\\right) \\quad \\forall \\pi^{+} \\in \\Pi$ where\n\n\\begin{equation}\n \\mathcal{L}^{+} = \\frac{(\\Sigma_{i \\in n^{+}} \\:\\sqrt{w_{i}}p_{i})^{2} - \\Sigma_{i \\in n^{+}} w_{i}p_{i} }{2} \\nonumber\n\\end{equation}\n\\end{theorem}\nThe proof of Theorem \\ref{theorem:lower_bound_csi} can be found in Appendix \\ref{appe:lower_bound_csi}. \\footnote{For a system with partial CSI the lower bound can be found by summing the lower bounds derived on sensors with and without CSI.\nNote that it may be possible to further tighten these lower bounds.}\n\n\\subsection{Whittle Index Scheduling Policies}\nThe scheduling problem can be viewed as a Restless Multi Armed Bandit (RMAB) with the sensors as arms whose age evolve even when they are not scheduled for transmission. Solving the RMAB problem is P-SPACE hard. However relaxing the constraints on the number of arms that can be played in every time slot and instead placing a constraint on its expectation, makes this problem tractable. The relaxed problem helps decouple the problem into $n-$subproblems, one for each sensor and the solution of this problem is called the Whittle index policy. Hence each subproblem consists of a single sensor, a single channel and a playing charge c (Lagrange multiplier) for the arm. Let $c(s(t),a(t))$ denote the cost incurred by action $a(t)$ in state $s(t)$. A policy $\\pi = \\{a(1),a(2) \\cdots\\}$ decides whether to idle the arm or play the arm at each time step. A policy is cost-optimal if it minimizes the average cost, defined as follows:\n\\[\\limsup_{T\\rightarrow\\infty}\\frac{1}{T}\\sum_{t=1}^{T}\\mathbb{E}_{\\pi}\\left[c(s(t),a(t))\\right|s(0)=0].\\]\n\\begin{definition} (Indexability)\nGiven a playing charge c, let S(c) be the set of states for which the optimal policy is to idle. Then the subproblem is called \\textit{indexable} if S(c) monotonically increases from the empty state to the entire state space as c increase from $-\\infty \\text{ to } \\infty$. \n\\end{definition}\n\\begin{definition}(Whittle index)\nThe Whittle index of a state is the playing charge that makes it equally lucrative to play or idle the arm.\n\\end{definition}\nWe now focus on three cases, namely, systems without CSI, systems with CSI, and systems with partial CSI, separately.\n\\subsubsection{System without CSI} Here the state of the channel is not known a priori and can be determined only after scheduling an information packet via the channel. We first formulate the decoupled subproblem. We drop the sensor index $i$ for further analysis as each sub-problem deals with a single sensor.\\\\\n\\textit{Decoupled subproblem}:\\\\\n\\textit{States}: The CA-AoI ($X(t)$) of the source defines its state $s(t)$\\\\\n\\textit{Actions}: The actions $\\in\\{0,1\\}$ are denoted by $a(t)$, where $a(t)=1$ indicates that sensor is scheduled to update the central station and $a(t)=0$ signifies that the sensor is kept idle.\\\\\n\\textit{Transition probabilities}:\nThe transition probability to state $s'$ after taking action a from state $s=x$ is:\n\\begin{align*}\n&\\mathbb{P}(s' = x | a=1,s=x) = 1-p\\\\\n&\\mathbb{P}(s' = 0 | a=1,s=x) = p\\\\\n&\\mathbb{P}(s' = x | a=0,s=x) = 1-p\\\\\n&\\mathbb{P}(s' = x+1 | a=0,s=x) = p\n\\end{align*}\n\\textit{Cost}: Let $\\Lambda(t) \\in \\{0,1\\}$ denote the channel state. Then the cost incurred by choosing action a at state $s = x$ is:\n\\[c(s,a) = w[x(1-a\\Lambda)+\\Lambda(1-a)]+ca.\\]\nThe above cost function can be simply deduced as the sum of the post-action age and the charge incurred when playing an arm.\n\nThe Markov Decision Process (MDP) for this subproblem has been shown in Fig. \\ref{fig:mdp} (a). Our next result shows that systems without CSI are indexable and characterizes the Whittle index in closed form.\n\n\\begin{theorem}\n\\label{theorem:UCSI_whittle}\n The scheduling problem for a system without CSI is indexable and the Whittle index of a sensor in state x is given by:\n \\[\\mathcal{W}(x,p) = \\frac{w(x+1)(x+2)}{2(2-p)}\\]\n\\end{theorem}\n\nWe use this result to design a Whittle index based scheduling policy which is to schedule the sensor with the highest Whittle Index in each time-slot. See Appendix \\ref{appe:Th1} for the proof.\\footnote{Note that it is not possible to know the channel states of the unscheduled sensors, under the system without CSI. To update the CA-AoI of an unscheduled sensor $i$ we set it's channel state $\\Lambda$ to be the outcome of a Bernoulli random variable with mean $p_i$.}\n\n\n\\subsubsection{System with CSI}\nIn this case the scheduler knows the states of the channel before scheduling. We begin by describing the subproblem for this case:\\\\\n\\textit{Decoupled subproblem}:\\\\\n\\textit{States}: The state $s(t)$ of the arm is defined by the tuple $(X(t),\\Lambda(t))$\\\\\n\\textit{Actions}: $a(t)=1$ indicates that sensor is scheduled to update the central station and $a(t)=0$ signifies that the sensor is kept idle.\\\\\n\\textit{Transition probabilities}: The transition probability to state $s'$ after taking action a from state $s=x$ is:\n\\begin{align*}\n&\\mathbb{P}(s' = (x,0) | a=0,s=(x,0)) = 1-p\\\\\n&\\mathbb{P}(s' = (x,1) | a=0,s=(x,0)) = p\\\\\n&\\mathbb{P}(s' = (x,0) | a=1,s=(x,0)) = 1-p\\\\\n&\\mathbb{P}(s' = (x,1) | a=1,s=(x,0)) = p\\\\\n&\\mathbb{P}(s' = (x+1,0) | a=0,s=(x,1)) = 1-p\\\\\n&\\mathbb{P}(s' = (x+1,1) | a=0,s=(x,1)) = p\\\\\n&\\mathbb{P}(s' = (0,0) | a=1,s=(x,1)) = 1-p\\\\\n&\\mathbb{P}(s' = (0,1) | a=1,s=(x,1)) = p.\n\\end{align*}\n\n\\begin{figure}[t]\n \\centering\n \\subfloat[System without CSI]{{\\includegraphics[width=0.5\\linewidth]{Figures\/UCSI.pdf} }}%\n \\qquad\n \\subfloat[System with CSI]{{\\includegraphics[width=.4\\linewidth]{Figures\/CSI.pdf} }}%\n \\caption{MDP for decoupled subproblems}%\n \\label{fig:mdp}\n\\end{figure}\n\\textit{Cost}: The cost incurred by choosing action a at state $s = x$ is:\n\\[c(s,a) = w[x(1-a\\Lambda)+\\Lambda(1-a)]+ca.\\]\nThe MDP for this subproblem has been represented in Fig. \\ref{fig:mdp} (b). Our next result shows that systems with CSI are indexable and characterizes the Whittle index in closed form.\n\n\\begin{theorem}\n\\label{theorem:CSI_whittle}\n The scheduling problem for a system with CSI is indexable and the Whittle index of a sensor in state (x,$\\Lambda$) is given by:\n \\begin{align*}\n \\mathcal{W}(x,p) = \\begin{cases}\n \\dfrac{w(x+1)(x+2)}{2} & \\text{if } \\Lambda = 1,\\\\\n 0 & \\text{otherwise.}\n \\end{cases}\n \\end{align*}\n\\end{theorem}\nWe use this result to design a Whittle index based scheduling policy which is to schedule the sensor with the highest Whittle Index in each time-slot. Note that the Whittle index gives us an online algorithm because it is independent of the channel statistics. See Appendix \\ref{appe:Th2} for the proof. \n\n\\subsubsection{System with partial CSI}\nWe now consider the case for which CSI is available only for a subset of the sensors. We refer to this setting as systems with partial CSI. As in the previous two cases, the scheduling problem reduces to $n$ subproblems and the previous results hold true for this case as well. Let $n^{-}$ and $n^{+}$ be the set of sensors without CSI and with CSI respectively. \nOur next result shows that systems with partial CSI are indexable and characterizes the Whittle index in closed form. This result follows from Theorems \\ref{theorem:UCSI_whittle} and \\ref{theorem:CSI_whittle}.\n\\begin{theorem}\n\\label{theorem:mixed_whittle}\n The scheduling problem for a system having partial CSI is indexable and the Whittle index of a sensor in state x is given by:\n \\begin{align*}\n \\mathcal{W}(x_{i},p_{i}) = \\begin{dcases}\n \\frac{w_{i}(x_{i}+1)(x_{i}+2)}{2(2-p_{i})} & \\text{if } i \\in n^{-},\\\\ \n \\frac{w_{i}(x_{i}+1)(x_{i}+2)}{2} & \\text{if } \\Lambda_{i} = 1, i\\in n^{+},\\\\\n 0 & \\text{otherwise.}\n \\end{dcases}\n \\end{align*}\n\\end{theorem}\n\n\n\n\n\\subsection{Randomized Scheduling Policies}\nWe refer to a policy as a randomized scheduling policy if it specifies a probability\ndistribution on the set of scheduling decisions at every time slot. To characterize the optimal\\footnote{Optimal among policies belonging to the given class of randomized scheduling policies.} randomized scheduling policy $\\pi^{*}$ for each of the three cases, we first find closed form expressions for the objective under a class of randomized policies and give algorithms to find policy parameters that optimize the objective.\n\n\\subsubsection{System without CSI}\n The randomized policy $\\pi^{-}$ in this case is to schedule source $i$ according to a Bernoulli process with parameter $\\Delta_{i}$. Let $n^{-}$ denote the set of all sensors without CSI and $\\vec{\\Delta}$ the vector of parameters $\\Delta_{i}$. Then the policy is:\n\\begin{gather*}\n \\pi^{-} = \\{\\text{Sched}(i) \\sim \\text{Bernoulli}(\\Delta_{i}) \\quad \\forall i \\in n^{-} | 1 \\geq \\Delta_{i} > 0 \\}.\n\\end{gather*}\n\nTo optimize the parameters $\\Vec{\\Delta}$ of the policy we relax the constraints on $\\pi^{-}$ from $\\sum_{i=1}^{n} a_{i}(t) = 1$ to $\\mathbb{E}\\left[\\sum_{i=1}^{n} a_{i}(t)\\right] = 1.$\nOur next result characterizes the performance of a randomized policy as a function of the parameters $\\vec{\\Delta}$.\n\\begin{theorem}\n\\label{theorem:UCSI_random}\nWithout loss of generality assume that $\\vec{p}>0$. Then under the policy $\\pi^{-}$, the freshness objective $J^{\\pi^{-}}$ as defined in Eq. \\ref{eq:1} is \n\\begin{equation}\n J^{\\pi^{-}} = \\sum_{i \\in n^{-}}\\frac{w_{i}(1-\\Delta_{i})}{\\Delta_{i}}.\n\\end{equation}\n\\end{theorem}\n\nCheck Appendix \\ref{appe:Th4} for the proof. Next, we use this result to design an optimization problem for finding the optimal parameters $\\vec{\\Delta}$.\n\n\\textit{Problem 1: Finding optimal $\\pi^{*} \\in \\pi^{-}$} -- Finding the best policy reduces to the following convex optimization problem.\n\\begin{gather*}\n \\text{minimize }J^{\\pi^{-}} = \\sum_{i\\in n^{-}}\\frac{ w_{i}(1-\\Delta_{i})}{\\Delta_{i}},\n \\\\\n \\text{subject to } \\sum_{i\\in n^{-}} \\Delta_{i} = 1 , 1\\geq \\Delta_{i}> 0 \\quad \\forall i \\in n^{-}. \\nonumber\n\\end{gather*}\n\nNote that the first constraint comes from the relaxation of the scheduling problem constraints. Using the Lagrange multiplier method, finding the optimal policy reduces to solving the following system of equations:\n\\begin{gather}\n \\Delta_{i} = \\sqrt{\\frac{w_{i}}{\\lambda}} \\quad \\forall i \\in n^{-},\\label{eq_deltas}\\\\\n \\sum_{i\\in n^{-}} \\Delta_{i} = 1. \\label{eq_lamda}\n\\end{gather}\n\n\nNote that an exact solution to $\\vec{\\Delta}$ can be obtained from the above system of equations. The optimization procedure is given in Algorithm \\ref{algo_1}.\n\n\n\\IncMargin{1em}\n\\begin{algorithm}\n\\SetKwInOut{Input}{input}\\SetKwInOut{Output}{output}\n\\Input{$p_{i}$ - Channel ON probability $\\forall i \\in n^{-}$ \\\\ $w_{i}$ - Weight of sensor $i$ $\\forall i \\in n^{-}$ }\n\\Output{$\\vec{\\Delta}^{*}$ }\n\\BlankLine\n$\\sqrt{\\lambda^{*}}$ $\\longleftarrow \\: \\sum_{i \\in n^{-}} \\sqrt{w_{i}}$ \\;\n \\For{i $\\in n^{-}$}{\n$\\Delta_{i}^{*}\\longleftarrow \\frac{\\sqrt{w_{i}}}{\\sqrt{\\lambda^{*}}}$\n}\n\\Return{$\\vec{\\Delta}^{*}$} \n\\caption{Finding $\\pi^{*} \\in \\pi^{-}$ (Problem 1)}\\label{algo_1}\n\\end{algorithm}\\DecMargin{1em}\n\n See Appendix \\ref{appe:alg1} for more details. Hence we schedule sensor $i$ with a probability $\\Delta^*_i$.\n\n\\subsubsection{System with CSI} For systems with CSI, the scheduling problem is again non-trivial since only one sensor can be scheduled in every time slot. Hence we schedule each sensor for only a fraction of the times for which the channel is in the ON-state. Let $n^{+}$ denote the set of sensors with CSI and $\\vec{\\alpha}$ denote the vector of parameters $\\alpha_{i}$. The policy $\\pi^{+}$ is:\n\\begin{gather*}\n \\pi^{+} = \\{\\text{Schedule sensor }i\\text{ with probability }\\alpha_{i}\\text{ if channel state = ON } \\: \\forall i \\in n^{+} | 1 \\geq \\alpha_{i} > 0. \\}\n\\end{gather*}\n Like the previous case we find an optimal policy for relaxed constraints. Our next result characterizes the performance of a randomized policy as a function of the parameters $\\vec{\\alpha}$.\n \\begin{theorem}\n \\label{theorem:CSI_random}\nWithout loss of generality assume that $\\vec{p}>0$. Then under the policy $\\pi^{+}$, the freshness objective $J^{\\pi^{+}}$ as defined in Eq. \\ref{eq:1} is \n\\begin{equation}\n J^{\\pi^{+}} = \\sum_{i\\in n^{+}}\\frac{ w_{i}(1-\\alpha_{i})}{\\alpha_{i}}. \n\\end{equation}\n \\end{theorem}\n Check Appendix \\ref{appe:Th5} for the proof. Note that sensor $i$ has channel ON probability $p_{i}$ and is scheduled with probability $\\alpha_{i}$ when channel state is ON. Thus the average rate at which it is scheduled is $p_{i}\\alpha_{i}$. This problem can also be setup as an optimization problem. \n\n\n\\textit{Problem 2: Finding optimal $\\pi^{*} \\in \\pi^{+}$} -- Finding the optimal policy can be reduced to the following convex optimization problem.\n\\begin{gather*}\n \\text{minimize }J^{\\pi^{+}} = \\sum_{i\\in n^{+}}\\frac{ w_{i}(1-\\alpha_{i})}{\\alpha_{i}}\n \\\\\n \\text{Subject to } \\sum_{i\\in n^{+}} p_{i}\\alpha_{i} = 1 ,\\:1 \\geq \\alpha_{i}> 0 \\quad \\forall i \\in n^{+}.\n\\end{gather*} \n\nThese constraints are derived from the relaxation of the constraints of the original scheduling problem. We ignore the $\\alpha_{i}\\leq 1$ constraint and optimize this using the Lagrange multiplier method. We describe how we account for this omitted constraint ahead. The optimal solution is obtained by solving the following system of equations:\n\\begin{gather}\n \\alpha_{i} = \\sqrt{\\frac{w_{i}}{p_{i}\\lambda}} \\quad \\forall i \\in n^{+}, \\label{csi_opt1}\\\\\n \\sum_{i\\in n^{+}} p_{i}\\alpha_{i} = 1. \\label{eq_csi}\n\\end{gather}\n\nAn exact solution of the above set of equations can be found. Algorithm \\ref{algo_2} describes the optimization procedure.\\\\\n\\IncMargin{1em}\n\\begin{algorithm}\n\\SetKwData{R}{R}\\SetKwData{ActiveSet}{ActiveSet}\\SetKwData{violation}{violation}\n\\SetKwInOut{Input}{input}\\SetKwInOut{Output}{output}\n\\Input{$p_{i}$ - Channel ON probability $\\forall i \\in n^{+}$ \\\\ $w_{i}$ - Weight of sensor $i$ $\\forall i \\in n^{+}$}\n\\Output{$\\vec{\\alpha}^{*}$ }\n\\BlankLine\n\\R$\\longleftarrow 1$\\;\n\\ActiveSet$\\longleftarrow n^{+}$\\;\n\\BlankLine\n\\While{\\ActiveSet $\\neq \\phi$ }{\n\\violation $\\longleftarrow$ False\\;\n\\BlankLine\n$\\sqrt{\\lambda^{*}}$ $\\longleftarrow \\sum_{i \\in {ActiveSet}}\\frac{\\sqrt{w_{i}p_{i}}}{R}$ \\;\n\n\\For{i $\\in$ \\ActiveSet}{\n$\\alpha_{i}^{*} = \\sqrt{\\frac{w_{i}}{p_{i}\\lambda^{*}}}$\\;\n\\uIf{$\\alpha_{i}^{*} \\geq$ 1}{\n$\\alpha_{i}^{*} = 1$\\;\n\\violation = True\\;\n\\R= \\R $-\\:p_{i}$\\;\n\\ActiveSet = \\ActiveSet $\\backslash \\{i\\}$\n}\n}\n\\uIf{\\violation == False}{Break}\n}\n\n\\Return{$\\vec{\\alpha}^{*}$} \n\\caption{Finding $\\pi^{*} \\in \\pi^{+}$ (Problem 2)}\\label{algo_2}\n\\end{algorithm}\\DecMargin{1em}\nIn Algorithm \\ref{algo_2}, $\\sqrt{\\lambda^{*}}$ is obtained by solving the following set of equations:\\\\\n\\begin{gather}\n \\alpha_{i} = \\sqrt{\\frac{w_{i}}{p_{i}\\lambda^{*}}} \\quad \\forall i \\in ActiveSet\\\\\n \\sum_{i\\in ActiveSet} \\alpha_{i} p_{i} = R.\n\\end{gather}\nIn Algorithm \\ref{algo_2}, we initialize the active set with $n^{+}$. If any policy parameter exceeds the inequality constraints i.e. $\\alpha_{i}^{*}\\geq 1$ then we set $\\alpha_{i}^{*}= 1$, remove it from the active set and modify the constraints. This loop is run until the active set is empty or all policy parameters satisfy the inequality constraints. Since the policy found through Algorithm \\ref{algo_2} is optimal for the relaxed constraint scheduling problem ($\\mathbb{E}\\left[\\sum_{i=1}^{n} a_{i}(t)\\right] = 1$) we need to make some implementational modification for the original problem ($\\sum_{i=1}^{n} a_{i}(t) = 1$). When more than one sensors are to be scheduled according to the policy, we schedule them greedily i.e. schedule the sensor having the highest weighted age. See Appendix \\ref{appe:alg2} for more details. \n\n\\subsubsection{System with partial CSI} We combine the policies derived for systems with and without CSI dealt with in the previous sections to design a scheduling policy for the system having partial CSI. Let $n^{-}$ and $n^{+}$ denote the set of channels without CSI and with CSI respectively. Like the previous cases we relax the constraints and make implementational modifications to account for them. The policy in this case is:\n\\begin{align*}\n\\pi= \\begin{cases}\n\\{\\text{Schedule(i)} \\sim \\text{Bernoulli}(\\Delta_{i}) \\quad \\forall i \\in n^{-} | 1 \\geq \\Delta_{i} > 0 \\},\\\\\n\\{\\text{Schedule(i) with probability }\\alpha_{i}\\\\\\text{ if channel state = ON } \\: \\forall i \\in n^{+} | 1 \\geq \\alpha_{i} > 0 \\} .\n\\end{cases}\n\\end{align*}\n\nOur next result characterizes the performance of a randomized policy as a function of the parameters $\\vec{\\Delta}$ and $\\vec{\\alpha}$.\n\\begin{theorem}\n\\label{theorem:mixed_random}\n Without loss of generality assume that $\\vec{p}>0$. Then under the policy $\\pi$, the freshness objective $J^{\\pi}$ as defined in Eq. \\ref{eq:1} is \n\\begin{equation}\n J^{\\pi} = \\sum_{i\\in n^{-}}\\frac{ w_{i}(1-\\Delta_{i})}{\\Delta_{i}} + \\sum_{i\\in n^{+}}\\frac{ w_{i}(1-\\alpha_{i})}{\\alpha_{i}}. \n\\end{equation}\n\\end{theorem}\nThis result is a straightforward extension of Theorems \\ref{theorem:UCSI_random} and \\ref{theorem:CSI_random}. Hence the scheduling problem can be setup as an optimization problem as follows:\n\n\\textit{Problem 3: Finding optimal $\\pi^{*} \\in \\pi$} -- Finding the optimal policy can be reduced to the following convex optimization problem.\n\\begin{gather*}\n \\text{minimize } J^{\\pi} = \\sum_{i\\in n^{-}}\\frac{ w_{i}(1-\\Delta_{i})}{\\Delta_{i}} + \\sum_{i\\in n^{+}}\\frac{ w_{i}(1-\\alpha_{i})}{\\alpha_{i}}, \n \\\\\n \\text{subject to } \\sum_{i\\in n^{-}}\\Delta_{i} + \\sum_{i\\in n^{+}} p_{i}\\alpha_{i} = 1,\\\\\n 1 \\geq \\alpha_{i}> 0 \\quad \\forall i \\in n^{+}\\:, 1 \\geq \\Delta_{i}> 0 \\quad \\forall i \\in n^{-}.\n\\end{gather*} \nWe ignore the inequality constraints for $\\alpha_{i}$ and use the Lagrange multiplier method to reduce the optimization problem to solving the following set of equations:\n\\begin{gather}\n \\Delta_{i} = \\sqrt{\\frac{w_{i}}{\\lambda}} \\quad \\forall i \\in n^{-},\\\\\n \\alpha_{i} = \\sqrt{\\frac{w_{i}}{p_{i}\\lambda}} \\quad \\forall i \\in n^{+},\\\\\n \\sum_{i\\in n^{-}}\\Delta_{i} + \\sum_{i\\in n^{+}} p_{i}\\alpha_{i} = 1. \\label{eq_3}\n\\end{gather}\n\nAn exact solution to the above system of equations can be found and the optimization procedure is described in Algorithm \\ref{algo_3}. \n\n\\IncMargin{1em}\n\\begin{algorithm}\n\\SetKwData{R}{R}\\SetKwData{ActiveSet}{ActiveSet}\\SetKwData{violation}{violation}\n\\SetKwInOut{Input}{input}\\SetKwInOut{Output}{output}\n\\Input{$p_{i}$ - Channel ON probability $\\forall i \\in n$ \\\\ $w_{i}$ - Weight of sensor i $\\forall i \\in n$}\n\\Output{$\\vec{\\Delta}^{*},\\vec{\\alpha}^{*}$ }\n\\BlankLine\n\\R$\\longleftarrow 1$\\;\n\\ActiveSet$\\longleftarrow n^{+}$\\;\n\\BlankLine\n\\While{\\ActiveSet $\\neq \\phi$ }{\n\\violation $\\longleftarrow$ False\\;\n$\\sqrt{\\lambda^{*}}$ $\\longleftarrow \\sum_{i \\in n^{-}}\\frac{\\sqrt{w_{i}}}{R}+ \\sum_{i \\in {ActiveSet}}\\frac{\\sqrt{w_{i}p_{i}}}{R}$ \\;\n\\BlankLine\n\\For{i $\\in$ \\ActiveSet}{\n$\\alpha_{i}^{*} = \\sqrt{\\frac{w_{i}}{p_{i}\\lambda^{*}}}$\\;\n\\uIf{$\\alpha_{i}^{*} \\geq$ 1}{\n$\\alpha_{i}^{*} = 1$\\;\n\\violation = True\\;\n\\R= \\R $-\\:p_{i}$\\;\n\\ActiveSet = \\ActiveSet $\\backslash \\{i\\}$\n}\n}\n\\uIf{\\violation == False}{Break}\n}\n\\For{i $\\in n^{-}$}{\n$\\Delta_{i}^{*}\\longleftarrow \\sqrt{\\frac{w_{i}}{\\lambda^{*}}}$\n}\n\\Return{$\\vec{\\alpha}^{*},\\vec{\\Delta}^{*}$} \n\\caption{Finding $\\pi^{*} \\in \\pi$ (Problem 3)}\\label{algo_3}\n\\end{algorithm}\\DecMargin{1em}\n\nIn Algorithm \\ref{algo_3} $\\sqrt{\\lambda^{*}}$ is obtained by solving the following set of equations:\n\\begin{gather}\n \\Delta_{i} = \\sqrt{\\frac{w_{i}}{\\lambda^{*}}} \\quad \\forall i \\in n^{-},\\\\\n \\alpha_{i} = \\sqrt{\\frac{w_{i}}{p_{i}\\lambda^{*}}} \\quad \\forall i \\in \\text{ActiveSet},\\\\\n \\sum_{i\\in n^{-}}\\Delta_{i} + \\sum_{i\\in \\text{ActiveSet}} p_{i}\\alpha_{i} = R. \\label{eq_4}\n\\end{gather}\nIt is straightforward to check that Algorithm \\ref{algo_3} utilizes the optimization procedure formulated in Algorithms \\ref{algo_1} and \\ref{algo_2}. When more than one sensors are to be scheduled according to the policy, we schedule the sensors in a greedy manner.\n\n\n\n\n\n\\section{Simulation Results}\n\\begin{figure}[t]\n\\centering\n\\begin{minipage}{.45\\textwidth}\n \\centering\n \\includegraphics[width=1\\linewidth]{Figures\/ucsi_3.png}\n \\caption{Average sum of weighted age on changing channel ON probability of sensor 3 ($p_{3}$) in a system without CSI }\n \\label{fig:UCSI3}\n\\end{minipage}%\n\\qquad\n\\begin{minipage}{.45\\textwidth}\n \\centering\n \\includegraphics[width=1\\linewidth]{Figures\/ucsi_2.png}\n \\caption{Average sum of weighted age on changing channel ON probability of sensor 2 ($p\n _{2}$) in a system without CSI }\n \\label{fig:UCSI2}\n\\end{minipage}\n\\end{figure}\n\n\\begin{figure}[h]\n\\centering\n\\begin{minipage}{.45\\textwidth}\n \\centering\n \\includegraphics[width = 1\\linewidth]{Figures\/n_UCSI.png}\n \\caption{Average sum of weighted age on varying number of sensors in a system without CSI}\n \\label{fig:UCSIn}\n\\end{minipage}%\n\\qquad\n\\begin{minipage}{.45\\textwidth}\n \n\\centering\n \\includegraphics[width = 1\\linewidth]{Figures\/csi_3.png}\n \\caption{Average sum of weighted age on changing channel ON probability of sensor 3 ($p_{3}$) in a system with CSI }\n \\label{fig:CSI3}\n\\end{minipage}\n\\end{figure}\n\n\\begin{figure}[t]\n\\centering\n\\begin{minipage}{.45\\textwidth}\n \\includegraphics[width = 1\\linewidth]{Figures\/csi_2.png}\n \\caption{Average sum of weighted age on changing channel ON probability of sensor 2 ($P_{2}$) in a system with CSI }\n \\label{fig:CSI2}\n\\end{minipage}%\n\\qquad\n\\begin{minipage}{.45\\textwidth}\n \n\\centering\n \\includegraphics[width = 1\\linewidth]{Figures\/n_CSI.png}\n \\caption{Average sum of weighted age on varying number of sensors in a system with CSI}\n \\label{fig:CSIn}\n\\end{minipage}\n\\end{figure}\n\n\n\\begin{figure}[t]\n\\centering\n\\begin{minipage}{.45\\textwidth}\n \\includegraphics[width=1\\linewidth]{Figures\/mixed_csi.png}\n \\caption{Average sum of weighted age on varying channel ON probability ($p_{2}^{+}$) of sensor 2 with CSI in a partial CSI system}\n \\label{fig:mixed_o}\n\\end{minipage}%\n\\qquad\n\\begin{minipage}{.45\\textwidth}\n \n\\includegraphics[width=1\\linewidth]{Figures\/mixed_ucsi.png}\n \\caption{Average sum of weighted age on varying channel ON probability ($p_{2}^{-}$) of sensor 2 without CSI in a partial CSI system}\n \\label{fig:mixed_uo}\n\\end{minipage}\n\\end{figure}\n\n\n\nIn this section we compare the performance of our policies against the greedy policy via simulations.\nWhile evaluating the objective we normalize the weights so that they sum to unity. The greedy policy for the system without CSI is to schedule the sensor having the highest weighted age times the channel ON probability in that time slot, i.e., $\\argmax_i\\left(w_{i}X_{i}(t)p_{i}\\right)$. In Fig. \\ref{fig:UCSI3} we simulate a system without CSI consisting of three sensors. We set $p_{1}=0.1,\\: p_{2} = 0.9$ and vary the channel ON probability of sensor 3 ($p_{3}$) from 0 to 1. The corresponding weights are set as $w_{1}=1,\\:w_{2}=1,\\:w_{3}=100$. We give sensor 3 a considerably larger weight to clearly observe the effect of changing it's channel ON probability. The Whittle's index policy outperforms the other two policies in this system. In Fig. \\ref{fig:UCSI2} we test our policies on a system without CSI consisting of two sensors where an important sensor has a poor connection. We fix $p_{1}=0.1$ and vary $p_{2}$ between 0 to 1. The weights are set as $w_{1} =1000,\\: w_{2} = 1$. The Whittle index policy and randomized policy outperform the greedy policy by a considerable margin in this system. In Fig. \\ref{fig:UCSIn} we investigate the effect of the size of the system on the performance of the policies. We vary the number of sensors from 10 to 40. In each system the channel statistics are chosen uniformly from 0 to 1. Similarly the weights are chosen uniformly at random from 1 to 100. The Whittle index policy outperforms both the policies. \n\n\nWe run similar experiments for a that system with CSI. The greedy policy for a system having CSI is to schedule the sensor having the highest weighted age i.e. $\\argmax_i\\left(w_{i}X_{i}(t)\\right)$. Fig. \\ref{fig:CSI3} shows the simulation of a system with CSI having 3 sensors. The parameters of the system remain the same. Once again the Whittle index policy performs the best and the randomized policy attains similar performance at higher channel ON probabilities. In Fig. \\ref{fig:CSI2} we simulate our policies in a system with CSI having important sensors transmitting through poor channels. The parameters remain the same as before. The Whittle index policy and the randomized policy perform substantially better than the greedy policy. We simulate the effect of varying system size on the performance of the policies in Fig. \\ref{fig:CSIn}. The greedy policy and the Whittle index policy yield good performance.\n\n\nIn Fig. \\ref{fig:mixed_o} we simulate a system having partial CSI. The system has 2 sensors with CSI and 2 sensors without CSI. The channel statistics of the sensors without CSI are $p_{1}^{-}=0.1,\\;p_{2}^{-}=0.9$. The channel ON probability of one of the sensors with CSI is set to $p_{1}^{+} = 0.1$ and the probability of the other sensor is varied from 0 to 1. The weights are setup as $w_{1}^{-}=w_{2}^{-} = w_{1}^{+}=1, \\;w_{2}^{+}=100$ . The Whittle index policy performs considerably better than the other policies. In Fig. \\ref{fig:mixed_uo} we simulate a similar system albeit wth parameters between sensors with and without CSI exchanged. The channel ON probabilities are $p_{1}^{-}=p_{1}^{+}=0.1,\\;p_{2}^{+}=0.9$ and $p_{2}^{-}$ is varied from 0 to 1. The weights are $w_{1}^{+}=w_{2}^{+} = w_{1}^{+}=1, \\;w_{2}^{-}=100$ Once again the Whittle index policy outperforms the others. \n\nFrom these results, and others which we omit due to lack of space, we conclude that the randomized scheduling policies work well when sensors have poor channel communication. However the Whittle index policy is effective across all types of system settings and achieves minimum cost. It outperforms the randomized policy by a substantial margin in larger systems and systems that have better connections.\n\n\\section{Discussion: AoI vs CA-AoI}\n\\label{sec:discuss}\n\n\\label{sec:discuss}\nIn this section, we discuss why the CA-AoI metric is more suitable than the original AoI metric for some multi-sensor systems. \n\nAs discussed before, the AoI of a sensor increases due to two reasons. The first is when an attempted update by a sensor fails due to poor channel conditions and the second is when the shared channel is used by some other sensor. The CA-AoI distinguishes between these two events by imposing a penalty by increasing the \"age\" of the information of a sensor at the monitoring station only in the latter case.\n\n\nMany systems deploy multiple sensors to measure the same quantity, for example temperature, close to each other to increase robustness to sensor failures as well as diversity. Consider a system with two sensors deployed in the same area. However, due to their placement, one sensor has significantly better channel conditions than the other. This can happen for instance if there is an obstruction between only one of the two sensors and the destination. If the sum AoI metric is used, under any ``good\" policy, a larger fraction of resources will be allotted to the sensor with poor channel conditions than if the sum CA-AoI metric is used. As a result, the throughput, i.e., the total number of measurements received by the destination over time will be lower in the first case. Since the quantity being measured by both sensors is roughly the same, CA-AoI might be the more appropriate metric for this case. Sum of CA-AoIs strikes a balance between rewarding the diversity obtained from getting measurements of the same physical process from two independent sources and ensuring that the resource allocation is not heavily tilted towards the sensor with poor channel conditions. On the other hand, using a greedy policy that blindly maximizes the throughput will be unable to meet the freshness requirements of the application. Whittle index policies for either choice of the metric have been demonstrated to work well in the unknown CSI setting. In Fig. \\ref{fig:throughput} we show the throughput achieved by Whittle index policies that optimize for AoI and CA-AoI in an equally weighted two sensor system, where the channel ON probability of the sensor with poor channel conditions is fixed to 0.1 and that of the other sensor is varied. We also simulate the ``greedy'' policy where the sensor with better channel conditions is scheduled in every time slot. We simulate the same setting in Fig. \\ref{fig:resources} and measure the fraction of resources allotted to the poor sensor. It can be clearly observed that the throughput obtained by using the CA-AoI metric is higher and the performance gap widens as the channel ON probability of the sensor with better channel conditions increases. In Fig. \\ref{fig:age}, we compare the freshness performance obtained from the AoI and the CA-AoI policies via the vanilla AoI metric. As expected, the greedy policy doesn't preserve any timeliness and the Whittle AoI policy outperforms the CA-AoI minimizing policy. While the AoI metric forces a higher scheduling rate of the sensor with poor channel conditions as the probability increases to meet the vanilla freshness requirement, the CA-AoI metric causes much fewer resources to be allocated to the poor sensor. However like the greedy policy, the Whittle CA-AoI policy doesn't completely discount the sensor with poor channel conditions and yields a more fairer allocation of resources and thus freshness of information at the cost of maximum throughput. \n\n\n\n\n\\begin{figure}[h]\n\\centering\n\\begin{minipage}[b]{.45\\textwidth}\n \\centering\n \\includegraphics[width=1\\linewidth]{Figures\/throughput_3.png}\n\\end{minipage}%\n\\qquad\n\\begin{minipage}[b]{.45\\textwidth}\n\\centering\n \\includegraphics[width=1\\linewidth]{Figures\/resources_poor_3.png}\n\\end{minipage}\n\\par\n\\begin{minipage}[t]{.45\\textwidth}\n\\centering\n \\caption{Throughput achieved by minimizing CA-AoI vs AoI}\n \\label{fig:throughput}\n\\end{minipage}\n\\qquad\n\\begin{minipage}[t]{.45\\textwidth}\n\\centering\n \\caption{Fraction of resources allocated to poor sensor while minimizing CA-AoI vs AoI}\n \\label{fig:resources}\n\\end{minipage}\n\n\\end{figure}\n\n\\begin{figure}[h]\n\\centering\n\\begin{minipage}[b]{.45\\textwidth}\n \\centering\n \\includegraphics[width=1\\linewidth]{Figures\/age_plot_3.png}\n\\end{minipage}%\n\\qquad\n\\begin{minipage}[b]{.45\\textwidth}\n\\centering\n \\includegraphics[width=1.1\\linewidth]{Figures\/aoi_thput.png}\n\\end{minipage}\n\\par\n\\begin{minipage}[t]{1\\textwidth}\n\\centering\n \\caption{Average sum of weighted AoIs while minimizing CA-AoI vs AoI. Left plot shows all three policies and the right plot compares AoI and CA-AoI Whittle policies}\n \\label{fig:age}\n\\end{minipage}\n\\end{figure}\n\\section{Conclusions}\nWe propose a variant of the AoI metric called Channel-Aware Age of Information (CA-AoI). The CA-AoI of a source at the intended destination is defined as the number of time-slots elapsed since the recent most update from the source was received in which the channel conditions were good enough for the source to send an update. The CA-AoI of a sensor is therefore, a measure of the number of missed opportunities to send an update since its recent most successful update. \nWe focus on a multi-source system that updates a monitoring station through a shared unreliable channel under different CSI models and characterize lower bounds on the metric. We model our scheduling problem as a Restless Multi Armed Bandit (RMAB) problem and prove indexability under all the CSI models. We show the threshold type structure of the optimal policy and derive the Whittle index for the problems. Besides this we also design stationary randomized scheduling policies and show that finding the optimal parameters reduces to simple convex optimization procedures. Via extensive simulations we show that the proposed policies outperform the greedy policies in several settings with the Whittle index policy being the most effective across all system settings. Finally, we discuss the effectiveness of using the sum of CA-AoI metric in a fair resource allocation across sensors and thus in achieving a higher throughput. \n\n\n\n\n\n\n\\bibliographystyle{.\/bibliography\/IEEEtran}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\n\nThe formation of Sun-like stars is set in motion by the collapse of a cold,\ndense cloud. Many different physical processes take place in the protostellar stage -- first few $10^5$ yrs that are critical to the subsequent evolution of the star and its planetary system \\citep{Lada1987}. The mass of the star and that of its\ncircumstellar disk are determined during this embedded phase\n\\citep{Hueso2005} and the first steps of planet formation must take\nplace then \\citep{Greaves2010, Williams2012, ALMA2015,Manara2018,Harsono2018,Tobin2020,Tychoniec2018a,Tychoniec2020,SeguraCox2020}. At the\nsame time, on larger scales, the collapsing envelope is dispersed by\nthe energetic action of bipolar jets and winds emanating from the star-disk\nsystem which create outflows of entrained gas and dust \\citep{Arce2006,Offner2014}\n\nRotational transitions of molecules are a powerful tool to probe other\ncomponents of the system and can be used to infer densities,\ntemperatures, UV fields, chemical abundances and kinematics\n\\citep{vanDishoeck1998,Evans1999}. Until recently, studies of low-mass protostars have suffered from insufficient spatial resolution to disentangle these different physical\ncomponents. The advent of submillimeter interferometry opened the possibility to study protostellar systems at much smaller scales than with single-dish observations \\citep[e.g.,][]{Chandler1996,Hogerheijde1999,Schilke1992, Wilner2000, Jorgensen2005b, Tobin2011}.\n\nWith the Atacama Large Millimeter\/submillimeter Array (ALMA), it is possible to\nimage many molecular lines on the relevant physical scales with achievable observing times at sub-arcsecond resolution. Impressive ALMA studies of individual low-mass protostars\nhave been presented, focusing both on simple species (< 6 atoms) and complex molecules (> 6 atoms)\n\\citep[e.g.,][]{Sakai2014b, Jorgensen2016, LopezSepulcre2017,Lee2019, Codella2018, LeeJE2019, Manigand2020, vanGelder2020, Bianchi2020}. The first ALMA surveys of complex molecules on a larger sample are taking place \\citep{Yang2021} and of Class I disks \\citep{Podio2020, Garufi2020}. The CALYPSO survey with NOEMA studied a larger sample of protostars but at more limited resolution and sensitivity \\citep{Belloche2020, Maret2020, Podio2021}.\n\nHere we present ALMA data of 16 protostellar sources covering rotational transitions of various molecules; we use these data to build a complete picture of what types of molecules trace which physical structures in protostars. This sample constitutes one of the largest combinations of high-resolution ALMA observations of Class 0\/I protostars to date in ALMA Band 3, 5, and 6. Covering a broad range of protostellar properties\nwithin the low-mass regime, the aim is to identify and describe key molecular tracers of future Sun-like stars and what physical components of star-forming sources they correspond to. Parts of the ALMA datasets presented here have been already published, focusing on different aspects: complex organic molecules \\citep{vanGelder2020,Nazari2021}; Class I disks temperature structure \\citep{vantHoff2020b}; outflows and high-velocity jets in Serpens \\citep{Hull2016, Tychoniec2019}, molecular emission associated with magnetic fields \\citep{Hull2017, LeGouellec2019}. In this work we make a comprehensive overview of these different datasets, making full use of those observations, with uniform analysis methods. This allows to reveal and systematise the molecular tracers of Class 0\/I protostars. Out of 16 presented sources 11 are included in upcoming {\\it James Webb Space Telescope} (JWST) observations with the Mid-Infrared Instrument (MIRI; \\citealt{Wright2015}) (\\citeyear{JWST1290,JWST1257}) and Near-Infrared Spectrograph (NIRSpec) ( \\citeyear{JWST1960,JWST1186,JWST1798,JWST2104})\n\n\n\\subsection{Physical components of a protostellar system}\n\nClass 0 sources are defined by their strong excess of submillimeter\nluminosity and very low bolometric temperatures \\textless 70~K\n\\citep{Andre1993, Chen1995}. These sources are associated with\npowerful outflows, and the envelope mass dominates the mass of the\nentire system. Class I sources are defined by having an infrared\nspectral index indicating strong reddening \\citep{Lada1987} with\nbolometric temperatures of 70--650 K \\citep{Chen1995}. Those systems\nhave already converted most of their envelope mass into disk and\nprotostar \\citep{Crapsi2008, vanKempen2009a, Maury2011}. For the\ntypical envelope masses of sources presented here and average disk\nmasses found by \\citet{Tychoniec2020}, the $M_{\\rm disk}\/M_{\\rm\n env}\\simeq$ 1\\% for Class 0 and $\\simeq$ 20\\% for Class I, with\nvalues up to 75--98\\% in cases of rotationally supported disks \\citep{Jorgensen2009}.\n\n\\begin{table*}\n\\caption{Targeted protostellar systems} \n\\label{table:targets} \n\\centering \n\\begin{tabular}{l l c c c c c c c} \n\\hline\\hline \nSource name & R.A. & Decl. & $d$ & Class & $L_{\\rm bol}$ & $T_{\\rm bol}$ & $M_{\\rm env}$ & Ref. \\\\\n & (J2000) & (J2000) & (pc) & & (L$_{\\odot}$) & (K) & (M$_{\\odot}$) & \\\\\n\n\\hline \nSerpens SMM1 & 18:29:49.8 & +01:15:20.5 & 439 & 0 & 109 & 39 & 58 & (1)\\\\\n\nSerpens S68N & 18:29:48.1 & +01:16:43.3 & 439 & 0 & 6 & 58 & 10 & (2) \\\\\n\nSer-emb 8 (N) & 18:29:48.7 & +01:16:55.5 & 439 & 0 & --- & --- & --- & ---\\\\\nSerpens SMM3 & 18:29:59.2 & +01:14:00.3 & 439 & 0 & 28 & 38 & 13 & (1) \\\\\n\n\nBHR 71 & 12:01:36.3 & -65:08:53.0 & 200 & 0 & 15 & 44 & 2.7 & (1)\\\\\n\nIRAS 4B & 03:29:12.0 & +31 13 08.1 & 293 & 0 & 7 & 28 & 4.7 & (1)\\\\\n\nPer-emb-25 & 03:26:37.5 & +30:15:27.8 & 293 & 0\/I & 1.9 & 61 & 2.0 & (2) \\\\\n\nB1-c & 03:33:17.9 & +31:09:31.8 & 293 & 0 & 5 & 48 & 15 & (2) \\\\\n\nHH211-mm & 03:43:56.8 & +32:00:50.2 & 293 & 0 & 2.8 & 27 & 19 & (2) \\\\\nL1448-mm & 03:25:38.9 & +30:44:05.3 & 293 & 0 & 13 & 47 & 15 & (2) \\\\\n\n\nL1527 IRS & 04:39:53.9 & +26:03:09.5 & 140 & 0\/I & 1.6 & 79 & 0.12 & (3) \\\\\n\nB5-IRS1 & 03:47:41.6 & +32:51:43.7 & 293 & I & 7 & 181 & 3.5 & (2) \\\\\nTMC1 & 04:41:12.7 & +25:46:34.8 &140 & I & 0.9 & 101 & 0.14 & (1) \\\\\nIRAS 04302 & 04:33:16.5 & +22:53:20.4 &140 & I & 0.7 & 300 & 0.05 & (1) \\\\\nL1489 IRS & 04:04:43.0 & +26:18:57.0 &140 & I & 3.8 & 200 & 0.2 & (1)\\\\\nTMC1A & 04:39:34.9 & +25:41:45.0 & 140 & I & 2.7 & 118 & 0.2 & (1)\\\\\n\n\n\n\n\\hline \n\n\\end{tabular}\n\\begin{tablenotes}\\footnotesize\n\\item{(1) \\citealt{Kristensen2012}, (2) \\citealt{Enoch2009}, (3) \\citealt{Green2013} }\n\n\\end{tablenotes}\n\\end{table*}\n\nThe different components of protostellar systems vary significantly in\ntheir physical conditions, such as density and temperature, molecular\nenrichment, and dynamics. Our current knowledge about them is described briefly below to set the scene for the interpretation of our data.\n\n{\\it Envelope.} The envelope surrounding a protostar is the material\nthat fuels the accretion process onto the star and disk. The\nphysical conditions in the outer envelope on scales of a few 1000 au\nare reminiscent of those of starless cores with heavy freeze-out, and their chemical\ncomposition is directly inherited from the cloud out of which the star\nis being born \\citep{Caselli2012}. Systematic motions such as infall\nor expansion can occur but otherwise they are characterized by low turbulence and\nnarrow (FWHM < 0.5 - 1 km s$^{-1}$) line profiles indicative of quiescent gas \\citep{Jorgensen2002}. \n\n{\\it Warm inner envelope}. In the innermost part of the envelope on scales of the\ndisk, temperatures rise above 100 K, so any water and complex organic\nmolecules (COMs) contained in ices are released from the grains back\ninto the gas where they are readily observed at submillimeter\nwavelengths. This region with its unique chemical richness is called\nthe hot core, or to distinguish it from its high-mass counterpart, hot\ncorino \\citep{Herbst2009}.\n\n{\\it Jets and outflows}. As the material is accreting from the envelope onto the disk, excess angular momentum has to be transported via a still elusive process to allow material to accrete on the growing protostar. Jets and outflows constitute compelling candidates to extract angular momentum via magnetic fields. In the earliest stages when the mass loss is at its peak, the densities are high enough to form molecules in the internal shocks in the jet \\citep{Bachiller1992, Tafalla2010}. Much slower (\\textless 20 km s$^{-1}$) and less collimated gas moving away from the protostar is called an outflow. Their origin remains debated. Large scale outflows reveal bow-shock shells and cavities possibly driven by the fast intermittent jet \\citep{Gueth1996, Gueth1999, Tychoniec2019}. Temperatures in shocked regions are much higher than in the surrounding envelope, up to a few thousand K, and sputtering of grain cores and ice mantles can further result in unique chemical signatures \\citep{Arce2008, Flower2013}. \n\n{\\it Outflow cavity walls.} These are the narrow zones in between the\ncold dense quiescent envelope material and the lower-density warm cone\nwhere outflows are propagating at large velocities. Cavity walls are\nexposed to UV radiation from the accreting star-disk boundary layer,\nwhich can escape through the outflow cavity without being extincted\n\\citep{Spaans1995}. This creates conditions similar to those found in\nPhoton Dominated Regions (PDRs), which occur throughout the\ninterstellar medium near sources of intense UV radiation\n\\citep{Hollenbach1997}. In units of the interstellar radiation field\n(ISRF, \\citealt{Draine1978}), typical values of 10$^2$--10$^3$ are found\non scales of $\\sim 1000$ au \\citep{vanKempen2009c, Yildiz2012,Benz2016,\n Karska2018}.\n \n\n\n{\\it Young disk.} In the inner envelope, a protoplanetary disk starts\nto form as the natural outcome of a rotating collapsing core\n\\citep{Ulrich1976, Cassen1981,Terebey1984}. \nA young disk should be rotating in Keplerian motion. At early stages it is difficult to identify whether the so-called embedded disk is\nrotationally supported, since any molecular emission from the disk is entangled with that from the envelope. In recent years several\nembedded disks have been identified to have Keplerian rotational\nstructure on scales of $\\sim$100 au \\citep{Tobin2012,Murillo2013,Ohashi2014, Yen2017}. Molecular tracers in young disks, apart from\nproviding the kinematic information, can probe their temperature\nstructure as well \\citep{vantHoff2018a}. \n\n\nThis work is organized as follows. In Section \\ref{section:observations}, the observations used in this work are presented, Section \\ref{section:results} presents the results of this work including detections and morphology of the targeted molecules. In Section \\ref{section:discussion} the results are discussed. with special focus on which molecular tracers are corresponding to each of the physical components. The focus is on a qualitative description, rather than quantitative analyses for which source specific models and more rotational transitions of a\ngiven molecule would be needed. We summarize our\nwork in Section \\ref{section:conclusions}.\n\n\\section{Observations}\n\\label{section:observations}\n\n\\subsection{Datasets}\n\nSix different ALMA 12m datasets at Band 3, 5, and 6 are used in this work to cover 14 out of 16 sources. The spatial resolution of all ALMA 12m datasets is comparable (0\\farcs3--0\\farcs6), except for 2017.1.01174.S, where Band 3 observations are obtained at 3\\arcsec. Additionally for 6 out of 16 sources in Band 6, ACA observations with 7m antennas were obtained at 6\\arcsec\\ resolution. \n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=1\\linewidth,trim={0cm 0cm 0cm 0cm}]\n \n {plots\/fig1.jpeg}\n \\caption{ Continuum emission at 1.3 mm of four example protostellar systems obtained with ALMA at 0\\farcs5 resolution. Symbols of stars point to confirmed protostellar sources, circles show condensations of continuum emission, without confirmed protostellar nature, dotted lines show outflow cavity walls, and dashed lines show streams of envelope material. Arrows indicate outflow directions.}\n \\label{fig:continuum_showcase_v1}\n\\end{figure*}\n\n\nThe targeted protostars are well-known objects located in different\nstar-forming regions. They span a range of properties within the\nlow-mass regime; the probed range of $L_{\\rm bol}$, $T_{\\rm bol}$ and\n$M_{\\rm env}$ is shown in Table \\ref{table:targets}, and are provided by a suite of observations across the infrared and submillimeter spectrum \\citep{Enoch2009,Kristensen2012,Green2013}.\n\nThe details of the observations are summarized in Table \\ref{table:observations}. The spatial resolution allows to observe protostellar systems at solar-system scales; Band 5 and 6 observations provide a resolution of $\\sim$0\\farcs5, which corresponds to a 70--220 au diameter for sources in our sample. Thus, regions down to 35-110 au radius in the inner envelope are probed. The Band 3 data achieve moderate resolution of $\\sim$3\\arcsec\\ which provides information on intermediate envelope scales of 500--1500 au. The ACA observations of six sources at 6\\arcsec\\ resolution probe envelope scales of 800--2000 au. \n\n\\subsection{Spectral setup of the observations}\n\nA collection of different datasets using different ALMA bands implies\nvarying spectral and spatial resolution as well as spectral coverage\nacross the analysis. This is the reason that throughout this paper the\nsources shown in the figures differ when presenting detections and maps of different\nmolecules. In all cases, when the molecule is discussed, only those\nsources where the given transition has been targeted are\ndiscussed. All non-detections are explicitly\nstated. Table \\ref{table:table_mols} provides a list of targeted\nmolecular transitions, with sources that have a particular line covered and\ndetected or not detected.\n\n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={2cm 1cm 2cm 0cm}]\n {plots\/fig2.jpeg}\n \n \\caption{Maps of key envelope tracers toward B1-c (Class 0, top) and TMC1 (Class I, bottom) obtained with ACA. Contours represent continuum emission at 1.3 mm observed with ACA. Note different distances to B1-c and TMC1 resulting in different spatial resolutions of the maps. {\\it Left:} C$^{18}$O 2 -- 1 {\\it Middle:} N$_2$D$^+$ 3 -- 2. {\\it Right:} DCO$^+$ 3 -- 2. All moment 0 maps are integrated from -2.5 to 2.5 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $.}\n \\label{fig:envelope_plot_no1_v1}\n\\end{figure*}\n\n\nThe ALMA observations presented here target different spectral setups across Band 3, 5, and 6. This allows to probe the strongly varying physical scales and conditions. In particular, our Band 3 data grants access to lines at very low excitation levels that enable tracing more extended material. Dust is less optically thick in Band 3 compared with Band 6 which potentially allows to peek inside the densest inner regions. Band 6 offers a usual set of tracers of outflows: CO, SiO and SO. \n\nCold outer envelopes with temperatures \\textless~20~K are probed\nwith low $E_{\\rm up}$ transitions. Additionally, non-thermal processes\nsuch as sputtering of material from the grains in the outflow, will\nalso be seen in low $E_{\\rm up}$ due to their lower critical\ndensities. On the other hand, thermal desorption from grains in\nthe innermost regions are best probed with lines with high $E_{\\rm up}$. With the large span of frequencies of the observations, different transitions of the same\nmolecule can be detected and used to trace different components of the system (e.g., a HNCO line at $E_{\\rm up}=$ 15 K is available in Band 3 and lines at 70 and 125 K are covered in Band 6). \n\n\\section{Results}\n\\label{section:results}\n\n\\subsection{Continuum emission from protostars }\n\nFigure \\ref{fig:continuum_showcase_v1} presents continuum emission maps toward four example protostars obtained with ALMA at $\\sim$ 0\\farcs5. The examples illustrate most characteristic features observed in the continuum maps. The continuum images for all sources are presented in Fig. \\ref{fig:continuum_no1_v1}.\n\nThe continuum emission observed at millimeter wavelengths (1.3 - 3 mm in our observations) traces thermal dust emission from the inner envelope and the embedded disk. In the Class 0 protostars, the central continuum source generally appears compact $R$ \\textless 100 au (e.g., B1-c, Fig. \\ref{fig:continuum_showcase_v1}). The example of SMM3 (Fig. \\ref{fig:continuum_no1_v1}) shows a large resolved dust structure perpendicular to the outflow, but its classification as a disk is not certain. The fact that we observe primarily compact continuum emission towards Class 0 sources is consistent with observations of confirmed rotationally-supported disks \\citep[e.g.,][]{Tobin2018, Maury2019, Tobin2020} and predictions of models \\citep{Visser2010,Harsono2015b, Machida2016}. While we assume that this compact emission belongs to the young, embedded disk, we do not have spatial and kinematic resolution to confirm the presence of Class 0 Keplerian disks in our sample.\n\nThe extended continuum emission in Class 0 sources is consistent with a significant amount of envelope material surrounding the protostar.\nIn the case of the SMM1 system, presented in Fig. \\ref{fig:continuum_showcase_v1} (left), the continuum clumps outside the central emission are components of multiple protostellar systems, marked with stars, confirmed by the presence of individual molecular outflows \\citep{Hull2016, Hull2017}. Binary components are also seen in TMC1, BHR71, and IRAS 4B (Fig. \\ref{fig:continuum_no1_v1}). In the case of S68N presented in Fig. \\ref{fig:continuum_showcase_v1}, two emission peaks that stand out from the diffuse envelope emission are marked with circles, but their protostellar nature is not confirmed.\n\n\n\n\\subsection{Protostellar envelope}\n\nWe present molecules that trace the bulk of the protostellar envelope in Fig. \\ref{fig:envelope_plot_no1_v1}. The protostellar envelope has a typical radius on the order of a few 1000 au \\citep{Jorgensen2002,Kristensen2012}. Thus, the sub-arcsecond ALMA 12m array observations tend to resolve-out the envelope emission. For instance, the maximum recoverable scale (MRS) of ALMA Band 6 observations at 0\\farcs4 presented here is 5\\arcsec, which is between 600--2000 au diameter depending on distance to the source. For that reason, we discuss in this section mainly the ALMA-ACA observations obtained at lower spatial resolution (6\\arcsec; 750--2500 au) for six sources in our datasets; Class 0 sources: B1-c, BHR71, Per-emb-25, SMM3, and IRAS 4B, and Class I source TMC1. The ACA can zoom-in on what was previously contained in a single-dish beam of 15--20\\arcsec, while the MRS of ACA (30\\arcsec) enables us to preserve sensitivity to large-scale emission. The MRS of all observations presented here are reported in Table \\ref{table:observations}. \n\n\n\nIn Fig. \\ref{fig:envelope_plot_no1_v1} typical envelope tracers C$^{18}$O 2--1 ($E_{\\rm up} = 16$ K), DCO$^+$ 3--2 ($E_{\\rm up} = 21$ K), and N$_2$D$^+$ 3--2 ($E_{\\rm up} = 22$ K), observed at 6\\arcsec\\ resolution with the ACA, are presented toward example Class 0 and Class I sources -- B1-c and TMC1, respectively. The emission from the presented molecules exhibits similar behaviour for all Class 0 sources, therefore B1-c serves as a representative case; TMC1 is the only Class I source in the sample with 7m observations available. The maps for all sources for which these molecules have been targeted can be found in Appendix \\ref{AppendixD}. All envelope tracers presented here are characterized by narrow line profiles with FWHM $\\sim 1$ km s$^{-1}$.\n\nThe C$^{18}$O emission peak coincides with the continuum peak for our six sources and appears to be compact, less than 1000 au diameter for B1-c and TMC1. For B1-c and all Class 0 sources (Fig. {\\ref{fig:envelope_co18_7m}), low-level extended C$^{18}$O emission is seen along the outflow direction. For the only Class I source targeted with the ACA, emission is marginally resolved in the direction perpendicular to the outflow.\n\n\nIn our observations N$_2$D$^+$ is seen extended in the direction perpendicular to the core major axis toward B1-c (Fig. \\ref{fig:envelope_plot_no1_v1}) and other Class 0 sources except IRAS 4B (Fig.{\\ref{fig:envelope_n2d+_7m}). In the case of IRAS 4B the emission from this molecule appears dominated by large-scale emission from the filament detected toward this source, connecting it with IRAS 4A \\citep{Sakai2012}. The peak of the N$_2$D$^+$ emission is significantly shifted from the continuum peak in all cases, with a significant decrease in the inner regions in some cases (see BHR 71 in Fig. {\\ref{fig:envelope_n2d+_7m}). Similar extended N$_2$D$^+$ emission in other Class 0 sources was seen by \\cite{Tobin2013} based on lower resolution SMA and IRAM-30m data. For TMC1 the N$_2$D$^+$ molecule is not detected. \n\nThe DCO$^+$ emission is seen extended in a similar fashion to what is observed for N$_2$D$^+$. However, contrary to N$_2$D$^+$, DCO$^+$ is brightest on the continuum peak for all sources except TMC1 and Per-emb-25. For these two sources, the emission peak is offset by 1000--2000 au from the continuum source in the direction perpendicular to the outflow. In the Class I source TMC1, DCO$^{+}$ is present on much smaller scales ($< 2000$ au radius) than in Class 0 sources.\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={0cm 0cm 0cm 0cm}]\n {plots\/fig3.jpeg}\n\\caption{Maps of the EHV jets observed in SiO. Moment 0 maps are presented in color scale with continuum emission at 1.3 mm presented in black contours, both obtained with 12m observations. SiO 4--3 map of HH211 integrated from -20 to -10 and from 10 to 20 km s$^{-1}$ w.r.t $\\varv_{\\rm sys}$; B1-c ntegrated from -70 to -40 and from 40 to 70 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $; SMM3 integrated from -60 to -40 and from 20 to 35 km s$^{-1}$ w.r.t $\\varv_{\\rm sys}$. }\n \\label{fig:ehv_no1}\n\\end{figure*}\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={2cm 0cm 2cm 2cm}]\n {plots\/fig4.jpeg}\n\n \\caption{Zoom-in on molecular bullets from the SMM3 jet (see Fig. \\ref{fig:ehv_no1}). CO, SiO, SO, and H$_2$CO molecular transitions are presented. {\\it Top:} Norther\/blueshifted bullet. Moment 0 maps are integrated from -60 to -40 km s$^{-1}$ w.r.t $\\varv_{\\rm sys}$. The map center is offset from the SMM3 continuum center by (--3\\farcs7, +10\\farcs3). {\\it Bottom:} Southern\/redshifted bullet. Moment 0 maps are integrated from 20 to 40 km s$^{-1}$. The map center is offset from the SMM3 continuum center by (+2\\farcs7, --7\\farcs).}\n \\label{fig:ehv_no2}\n\\end{figure*}\n\n\n\n\n\n\n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={0cm 0cm 0cm 0cm}]\n {plots\/fig5.jpeg}\n\n \\caption{Low-velocity outflow in CO, SO, and SiO. Moment 0 maps of CO toward TMC1, SO and SiO map toward B1c are integrated from -10 to 10 km s$^{-1}$ w.r.t $\\varv_{\\rm sys}$.}\n \\label{fig:lowvel}\n\\end{figure*}\n\n\n\\subsection{Outflows and jets}\n\\label{section:results_outflows}\n\nFigure \\ref{fig:ehv_no1} presents the extremely high-velocity (EHV)\nmolecular jet component for HH211, B1c, and SMM3 observed in\nSiO with the ALMA 12m array; the L1448-mm EHV is shown in Fig. \\ref{fig:outflow_showcase_no1}. The latter and HH211 are well-known EHV sources\n\\citep{Guilloteau1992, Lee2007} while SMM3 and B1-c are new detections\nof the jet component. HH211 shows SiO emission at low-velocities because the outflow is almost in the plane of the sky, but the high velocities are\nevident from the large proper motion movements of the bullets\n($\\sim$115 km s$^{-1}$; \\citealt{LeeCF2015}). CO, H$_2$CO, and SiO in\nthe EHV jets of Emb8N and SMM1 are presented in detail in\n\\cite{Hull2016} and \\cite{Tychoniec2019}.\n\nThese data are particularly interesting as still only few molecules\ntracing EHV jets have been identified to date (see \\citealt{Lee2020} for\nreview). Apart from those presented here -- CO, SiO, SO, and H$_2$CO-- \nmolecules such as HCO$^+$ and H$_2$O have been seen in this\nhigh-velocity component \\citep{Kristensen2012,LeeCF2014}. What is\nespecially important to highlight is the third detection of a H$_2$CO\nbullet in SMM3 after IRAS 04166 \\citep{Tafalla2010} and Emb8N\n\\citep{Tychoniec2019}. These detections mean that either a significant fraction of ice-coated dust is released with the jet, or that the H$_2$CO is efficiently produced in the jet through gas-phase chemistry.\n\n\nIn the case of L1448-mm and HH211, there are\nseveral molecular bullets along the jet axis with velocities up to 100 km~s$^{-1}$, while both B1-c and SMM3\nshow a much simpler structure with two bullets detected on one side in\nthe former and a single pair of symmetrically placed bullets observed\nin the latter case. B1-c actually has a pair of bullets $\\sim$~200 au from the continuum peak, with the other bullet at 2500 au only seen in the redshifted part of the jet. The emission in SiO and SO appears very similar (Fig. \\ref{fig:sio_outflows_no2}, Fig. \\ref{fig:so_outflow}). There are no other molecules tracing the high-velocity component toward this source. H$_2$CO and $^{12}$CO are not targeted with our ALMA 12m datasets toward B1-c. The SMM3 jet has two distinct high-velocity bullets at $\\sim$~3200 au from the source which appear similar in CO, SiO and SO (see zoom-in on Fig \\ref{fig:ehv_no2}). Additionally, the redshifted bullet shows faint, but significant emission from H$_2$CO. No traces of H$_2$CO are found in the blueshifted outflow.\n\n\n\nFigure \\ref{fig:lowvel} presents low-velocity outflow tracers CO 2--1 ($E_{\\rm up}=16$ K) for TMC1, SO 5$_6$--4$_5$ ($E_{\\rm up}=35$ K), and SiO 4--3 ($E_{\\rm up}=21$ K) for B1-c. In Fig. \\ref{fig:co_outflows} we present an overview of CO 2--1 emission for five sources obtained with the ALMA 12 m array at 0\\farcs4 resolution. The sources show a variety of emission structures in the low velocity gas (\\textless 20 km s$^{-1}$). In all cases, we do not capture the entirety of the outflows as they extend beyond the primary beam of observations ($\\sim$ 30\\arcsec). SMM3 and Emb8N have very narrow outflow opening angles ($<$ 20 degrees), while SMM1, S68N and TMC1 present larger opening angles.\n\nCO emission is especially prominent in the cavity walls, which can be related to both the limb brightening effect as well as higher (column) density of the material in the outflow cavity walls. This is especially highlighted in the Class I source, TMC1, where CO emission is almost exclusively seen in the outflow cavity walls. Even though CO is piling up in this region, it is observed at velocities up to 15 km s$^{-1}$ so it is clearly tracing the entrained material and not the envelope. The lower envelope density in Class I results in less material to be entrained in the outflow. In SMM1, three CO outflows from SMM1-a, SMM1-b, and SMM1-d are overlapping \\citep{Hull2016,Tychoniec2019}.\n\n\n\nIn Fig. \\ref{fig:sio_outflows_no2}, SiO maps are presented: Band 5 SiO 4--3 ($E_{\\rm up}=21$ K) and Band 6 SiO 5--4 ($E_{\\rm up}=31$ K) data are shown in velocity ranges corresponding to the low-velocity outflow. In contrast to CO emission, the low-velocity SiO is mostly observed in clumps of emission instead of tracing the entirety of the outflowing gas. Several such clumps can be seen in the S68N source. In some cases, the clumps are relatively symmetric (Emb8N, B1-c), while monopolar emission is seen in other examples (L1448-mm, SMM1-d). In the case of SMM1-a and SMM1-b, very weak SiO emission at low velocities is observed. SiO emission in outflows is exclusively present in the Class 0 sources, while absent in the Class I sources, TMC1 and B5-IRS1, covered in these data sets.\n\nFig. \\ref{fig:so_outflow} presents SO 5$_6$--4$_5$ ($E_{\\rm up}=35$ K) and SO 6$_7$--5$_6$ ($E_{\\rm up}=47$ K) observations in Band 6. The emitting regions of SO are comparable with those of SiO for the Class 0 sources. The cases of S68N and B1-c show that SO emission also peaks at the source position while SiO is absent there. Thus, SO and SiO do not always follow each other and some SO might be associated with hot core emission \\citep{Drozdovskaya2018}. Important differences are observed for TMC1, where SO seems to be associated with the remainder of the envelope or the disk, while the SiO is not detected toward this source, as mentioned above.\n\n\nHCN 1--0 ($E_{\\rm up}=4$ K) and H$^{13}$CN 2--1 ($E_{\\rm up}=12$ K) maps are presented in Fig. \\ref{fig:hcn_outflow} and \\ref{fig:h13cn}, respectively. HCN is clearly seen in outflowing material enhanced in similar regions as low-velocity SiO. For Emb8N the HCN emission has been associated with intermediate velocity shock \\citep{Tychoniec2019}. In B1-c and L1448-mm weak extended emission along the outflow direction is detected but H$^{13}$CN strongly peaks on source. In the case of HH211, H$^{13}$CN is seen only in the outflow, with a geometry consistent with the outflow cavity walls, but with velocity profiles that are consistent with the outflowing material.\n\n\n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={2cm 1cm 2cm 0cm}]\n {plots\/fig6.jpeg}\n \\caption{Maps of the ice mantle tracers toward the S68N outflow, with the CO low-velocity outflow map for reference. {\\it Top:} CO, H$_2$CO and CH$_3$OH moment 0 maps obtained in Band 6 at 0\\farcs5 resolution. Circles show regions from which spectra were obtained for analysis in Section 7.1. {\\it Bottom:} CH$_3$CHO, HNCO, and CH$_3$CN moment 0 maps obtained in Band 3 at 2\\farcs5 resolution. The emission is integrated from -10 to -1 km s$^{-1}$ and from 1 to 10 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $.} \n \\label{fig:icemantle_no1}\n\\end{figure*}\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={2cm 0cm 2cm 0cm}]\n {plots\/fig7.jpeg}\n\\caption{Maps of the outflow cavity wall tracers toward SMM3 and B1c, with low-velocity outflow map for reference. {\\it Top:} Moment 0 maps toward SMM3 of CO 2--1, c-C$_3$H$_2$ 6$_{1,6}$--5$_{0,5}$ , and $^{13}$CS 5--4 obtained in Band 6 at 0\\farcs5 resolution and CN 1--0 in Band 3 at 3\\arcsec with continuum emission at the same band and resolution in black contours. {\\it Bottom:} Moment 0 maps toward B1c of SO 6$_{7}$--5$_{6}$, C$_2$H 3$_{2.5,3}$--2$_{1.5,1}$ and H$^{13}$CO$^+$ 3--2 obtained at 0\\farcs5 and CN 1--0 at 3\\arcsec with continuum emission at the same band and resolution in black contours. The emission is integrated from -5 to -1 km s$^{-1}$ and from 1 to 5 km s$^{-1}$ w.r.t $\\varv_{lsr} $. Outflow directions and delineated cavity walls are shown in C$_2$H and C$_3$H$_2$ maps.} \n \\label{fig:hydrocarbons_no1}\n\\end{figure*}\n\n\n \nIce-mantle tracers are a different class of molecules detected in low-velocity protostellar outflows. They are produced and entrained through interactions between the jet and the envelope. Here we present ALMA 12m array observations in Band 6 at 0\\farcs5 resolution for CO 2 -- 1 ($E_{\\rm up}=17$ K), CH$_3$OH 2$_{1,0}$ -- 1$_{0,0}$ ($E_{\\rm up}=28$ K), and H$_2$CO 3$_{0,3}$ -- 2$_{0,2}$ ($E_{\\rm up}=21$ K) , and in Band 3 at 3\\arcsec\\ for CH$_3$CN 6$_1$ -- 5$_1$ ($E_{\\rm up}=26$ K), CH$_3$CHO 6$_{1,6,0}$ -- 5$_{1,5,0}$ ($E_{\\rm up}=21$ K), and HNCO 5$_{0,5}$ -- 5$_{0,4}$ ($E_{\\rm up}=16$ K). Fig. \\ref{fig:icemantle_no1} compares maps of integrated emission from those molecules with those of CO for S68N. All ice-mantle tracers detected in the outflow are observed in their low-energy transitions. \nAdditional maps for S68N are presented in the Appendix (Fig. \\ref{fig:fig9_extra}): Band 6 0\\farcs5 resolution image of CH$_3$CHO 14$_{0,14}$--13$_{0,13}$ ($E_{\\rm up}=96$ K) and H$_2$CCO 13$_{1,13}$--12$_{1,12}$ ($E_{\\rm up}=101$ K), which is overlapping with NH$_2$CHO 12$_{2,10}$--12$_{2,10}$ ($E_{\\rm up}=92$ K), and the Band 3 image at 3\\arcsec\\ resolution of CH$_3$OCHO 10$_{0,10}$--9$_{0,9}$ ($E_{\\rm up}=30$ K). \n\nAround the frequency of H$_2$CCO 3$_{1,13}$--12$_{1,12}$ ($E_{\\rm up}=101$ K) line an extended emission can be seen in the outflow, this is however coincident with the NH$_2$CHO which is only 4 km s$^{-1}$ apart (Fig. \\ref{fig:fig9_extra}). NH$_2$CHO is more commonly observed in the shocked regions than H$_2$CCO \\citep{Ceccarelli2017, Codella2017}; it is possible that those lines are blended. More low-energy transitions would be required to confirm the identification of these lines.\n\n\nThe velocities observed for ice-mantle tracers in the outflow are \\textless 15 km s$^{-1}$ with respect to the systemic velocity. This is slower than the CO and SiO outflow line wings which have velocities up to 20--30 km s$^{-1}$. On the other hand, the lines are clearly broader than those of molecular tracers of UV-irradiated regions that trace passively heated gas (see Section \\ref{section:outflow_cavity_walls}). \n\nIce-mantle tracers are also detected in SMM3 and B1-c, two Class 0 protostars (Fig. \\ref{fig:161} and \\ref{fig:151}). For SMM3 only a lower $A_{ij}$ transition of CH$_3$OH with $E_{\\rm up}=$ 61 K was targeted and not detected towards this source. B1-c has its methanol emission confused with the high-velocity SO emission, whereas emission from other COMs in the outflow is weak and appears only on the redshifted part of the outflow. Thus, S68N is the best case to study the composition of shock-released ice mantles.\n\n\\subsection{Outflow cavity walls}\n\nIn this section, we highlight key molecules detected in the outflow cavity walls. It is challenging to precisely distinguish cavity walls from the outflowing material. The velocity of the gas in the cavity walls should be lower than in the outflow, as the cavity wall contains envelope material at rest but which is passively heated by UV radiation. We first discuss maps of species associated with cavity walls and then their line profiles.\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={0cm 0cm 0cm 0cm},draft=False]\n {plots\/fig8.jpeg}\n\n \\caption{Spectra obtained at the cavity wall positions for hydrocarbons (red) and ice-mantle tracers (blue). {\\it Left:} C$_2$H 3$_{2.5, 2}$--2$_{1.5, 1}$ ($E_{\\rm up}=$ 25 K) and CH$_3$OH 2$_{1,0}$--1$_{0,1}$ ($E_{\\rm up}=$ 28 K) spectra for S68N, {\\it Middle:} C$_2$H 3$_{2.5, 2}$--2$_{1.5, 1}$ ($E_{\\rm up}=$ 25 K ) and SO 6$_7$--5$_6$ ($E_{\\rm\n up}=48$ K) spectra for B1-c, {\\it Right:} c-C$_3$H$_2$ $4_{4,1}$--$3_{3,0}$ ($E_{\\rm\n up}=32$ K), H$_2$CO 3$_{2,1}$--2$_{2,0}$ ($E_{\\rm\n up}=68$ K), and $^{13}$CS 5--4 ($E_{\\rm\n up}=33$ K) spectra for SMM3.}\n \\label{fig:spectra_coms_outflow_no1}\n\\end{figure*}\n\n\n\\begin{figure}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={0cm 0cm 0cm 0cm}]\n {plots\/fig9.jpeg}\n \n \\caption{Compact emission for B1-c and SMM3 for various molecules tracing the warm inner envelope (hot core). Moment 0 maps shown in colorscale integrated from -3 to 3 km s$^{-1}$ w.r.t $\\varv_{\\rm sys}$. 1.3 mm continuum presented in contours.} \n \\label{fig:hotcore_v1}\n\\end{figure}\n\nFigure \\ref{fig:hydrocarbons_no1} presents integrated emission maps of key tracers discussed in this section for two examples: SMM3 and B1-c. Plots for the remaining sources (S68N, Emb8N, and TMC1) are presented in the Appendix in Fig. \\ref{fig:hydrocarbons_no2}. Key tracers of the outflow cavity walls are simple unsaturated\nhydrocarbon molecules: c-C$_3$H$_2$ $4_{4,1}$--$3_{3,0}$ ($E_{\\rm\n up}=32$ K) for SMM3 and TMC1, and C$_2$H $3_{2.5,3}$--$2_{1.5,2}$\n($E_{\\rm up}=25$ K) for S68N, B1-c, and Emb8N, as seen in maps\nobtained with ALMA Band 6 at 0\\farcs5 resolution. \n\n\nIn Emb8N and SMM3 the emission from C$_2$H and c-C$_3$H$_2$, respectively, is symmetric; it appears similar in extent and shape on both sides of the continuum source. Comparison with CO emission, which traces the bulk of the outflowing gas, indicates that the hydrocarbons are located in the outflow cavity walls close to the source. A higher energy transition of c-C$_3$H$_2$ 7$_{2,6}$--7$_{1,7}$ $E_{\\rm up}$=61 K is seen towards SMM3 closer to the protostar compared with the lower-energy transition. This reflects the increase of temperature of the cavity walls closer to the source.\nFor B1-c, the emission from C$_2$H is U-shaped suggestive of a cavity wall, stronger on the blueshifted side of the outflow, which could be either a projection effect or an asymmetry in the envelope structure. For B1-c no ALMA CO observations exist to compare with the bulk of the outflow at comparable resolution; however, the other outflow tracer, SO, confirms the outflow direction and rough extent of the outflow cavity walls. Moreover, the shape of the cavity walls is consistent with the appearance of the CO 3--2 outflow observed with SMA toward this source at 4\\arcsec\\ resolution \\citep{Stephens2018}.\n\n\nS68N presents a chaotic structure (Fig. \\ref{fig:hydrocarbons_no2}, top), but C$_2$H is found elongated in the outflow direction. While it is difficult to identify the cavity wall, the C$_2$H emission surrounds the CO outflow emission. The C$_2$H emission toward this source is asymmetric, with stronger emission in the blueshifted part of the outflow. Emission of c-C$_3$H$_2$ toward the Class I source TMC1 (Fig. \\ref{fig:hydrocarbons_no2}, bottom) is not directly related to the cavity walls, but is extended perpendicular to the outflow, which suggests that c-C$_3$H$_2$ traces the envelope or extended disk material. \n\nFigure \\ref{fig:hydrocarbons_no1} also shows CN 1--0 ($E_{\\rm up}$ = 5 K) observed at 3\\arcsec\\ resolution in Band 3 for SMM3 and B1-c. Compared with C$_2$H, CN is tracing similar regions. In S68N CN has a similar extent as C$_2$H but not over the full extent of the outflow traced by CO. In B1-c, the CN emission has a similar shape of the cavity wall cone as seen in C$_2$H, but also a significant contribution from larger scales is detected. In all cases the CN emission avoids the central region, which likely results from on-source absorption by the foreground CN molecules. \n\nIn some cases, like SMM3, the extent of the CN is broader than hydrocarbons, more comparable with CO, but the narrow linewidths suggest that this emission is still associated with passively irradiated envelope rather than with the entrained outflow.\n\nTMC1 presents a high-resolution example of CN emission (Fig. \\ref{fig:hydrocarbons_no2}). The offset between CO and CN reveals a physical\nstructure of the inner regions of the protostellar system: the\nentrained outflow traced with CO appears closer to the jet axis, while\nCN highlights the border between the outflow cavity wall and quiescent\nenvelope. CN is sensitive to UV radiation, as it can be produced with atomic C and N, whose abundances are enhanced in PDRs, with UV photodissociation of HCN contributing as well\n\\citep{Fuente1993,Jansen1995a,Walsh2010,Visser2018}.\n\nH$^{13}$CO$^{+}$ emission is presented for B1c (Fig. \\ref{fig:hydrocarbons_no1}), and S68N and Emb8N (Fig. \\ref{fig:hydrocarbons_no2}) observed in Band 6 at 0\\farcs4 resolution. The bulk of the emission from this molecule appears to be related to the cold envelope, however streams of material can be seen in B1-c and S68N. The streams of gas observed in H$^{13}$CO$^+$ are coincident with the cavity wall observed in C$_2$H. As H$^{13}$CO$^+$ is expected to probe the dense envelope, the similarity of the morphology of the traced material between H$^{13}$CO$^+$ and C$_2$H and CN shows that the envelope material is UV-irradiated. $^{13}$CS observed in Band 6 with the 12m array is detected for SMM3 (Fig. \\ref{fig:hydrocarbons_no1}). The morphology of $^{13}$CS emission is very similar to that of c-C$_3$H$_2$. \n\n\nIn Fig. \\ref{fig:spectra_coms_outflow_no1} spectra of ice mantle\ntracers, CH$_3$OH and H$_2$CO, and the hydrocarbon molecules, C$_2$H and\nC$_3$H$_2$ are presented. All spectra are shifted by their source\nvelocity to zero km s$^{-1}$. In case of S68N, it is seen that C$_2$H\nand CH$_3$OH have very similar line profiles indicating that they\ntrace similar material. The width of $\\sim 10$ km$^{-1}$ suggests\nthat this material is entrained with the outflow. A narrow component\nappears to be superposed at systemic velocities. Note that fine splitting of C$_2$H blends\nthe spectra although the other transition at +2 km s$^{-1}$ does\nnot affect the blueshifted velocity component. In contrast, B1c shows\nonly remarkably narrow C$_2$H line profiles with a FWHM of $\\sim$ 2 km\ns$^{-1}$, and SMM3 has similarly narrow c-C$_3$H$_2$ and $^{13}$CS lines compared with broader H$_2$CO emission (Fig. \\ref{fig:spectra_coms_outflow_no1}, right). \n\n\n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={3cm 1cm 3cm 0cm}]\n {plots\/fig10a.jpeg}\n \\includegraphics[width=0.95\\linewidth,trim={3cm 1cm 3cm 0cm}]\n {plots\/fig10b.jpeg}\n \\caption{Images of Class I disks observed with ALMA 12m in Band 6 \\citep{vantHoff2020b}. {\\it Top:} Moment 0 maps of C$^{17}$O at 0\\farcs4 resolution integrated from -10 to 10 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $. {\\it Bottom:} Moment 0 maps of CN integrated from -2 to 2 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $. Continuum contours in black.} \n \\label{fig:disks_no1_v1}\n\\end{figure*}\n\n\\subsection{Inner envelope}\n\\label{section:results_inner_env}\n\nFig. \\ref{fig:hotcore_v1} shows emission from H$_2$CCO, HNCO, t-HCOOH,\nSO, H$_2$CS, and H$^{13}$CN for the Class 0 protostar B1-c, and H$_2$S\nand OCS lines for SMM3; all observed with the ALMA\n12m array at 0\\farcs5. Several molecules tracing the inner hot envelope are detected in 7m data and are presented in Fig. \\ref{fig:102}. CCS is detected for SMM3, BHR71, and IRAS 4B, while non-detected for B1-c, TMC1, and Per-emb-25. OCS and H$_2$S (Fig. \\ref{fig:102}) for all targeted in 7m Class 0 sources while non-detected for Class I sources.\n\n\n\n\nThe SO 6$_7$--5$_6$ $E_{\\rm up}=48$ K line is seen to\npeak on the central source for B1-c and S68N (Fig. \\ref{fig:so_outflow}). SO has already been discussed in the outflow (Section \\ref{section:low-velocity_outflow}), but it is also\nprominent in the inner envelope. While the spatial resolution does not\nallow to disentangle the hot core emission from the small-scale\noutflow on a few hundred au scale, there is a difference between these\ntwo sources and SMM3 and Emb8N. The latter two sources show a\nsubstantial decrease in SO intensity towards the continuum peak, i.e.,\nthey have prominent SO emission in the outflow, but not from the hot\ncore. This suggests that sources like B1-c and S68N, which are\nbright in SO toward the continuum emission peak, have an additional\ncomponent responsible for SO emission. This is highlighted by the\nnarrower lines of SO toward the continuum peak compared with the\noutflow in S68N (Fig. \\ref{fig:so_spectra_v1}). The narrow component, visible\nin spectra taken on-source, has a width of $\\sim$ 5 km s$^{-1}$. The main component of the spectrum taken in the blueshifted outflow has a similar width but has a more prominent line wing up to 20 km s$^{-1}$.\n\n\nTMC1 clearly shows SO emission toward both components of the\nbinary system, slightly offset from their peak positions\n(Fig. \\ref{fig:so_outflow}). There is also a molecular ridge present in SO close to the disk-envelope interface.\n\nHNCO and HN$^{13}$CO are detected toward B1-c and S68N peaking on source in higher $E_{\\rm up}$ transitions \\citep{Nazari2021}. For lines with $E_{\\rm up} < $90 K an extended component is also detected in the outflow. SMM3 and Emb8N have no detections of HNCO on source, but for SMM3 this molecule appears in the outflow. For all Class I sources where the relatively strong HNCO 11$_{0,11}$--10$_{0,10}$ line ($A_{ij}=2\\times10^{-4}$ s$^{-1}$, $E_{\\rm up}$=70 K) was targeted, it was not detected.\n\nOCS is detected toward SMM3 peaking in the center; S68N and SMM1 show centrally peaked O$^{13}$CS detection, a minor isotopologue signalling a high abundance of OCS (Fig. \\ref{fig:o13cs_appendix}). In all cases the emission is moderately resolved; of size $\\sim$ 200 au in case of SMM3 and detected up to 500 au away from source for S68N and SMM1.\n\nH$_2$S shows strong emission toward SMM3 and is also weakly present in TMC1. For SMM3 the emission is resolved along the outflow direction and perpendicular to the expected disk axis. Those are the only two\nsources for which H$_2$S 12m array data were taken. Additionally, the 7m data\npresented in the Appendix (Fig. \\ref{fig:102}) show prominent, centrally peaked H$_2$S\nemission for four more Class 0 sources. \n\nH$_2$CS is detected for B1-c, S68N and L1448-mm through a line with\n$E_{\\rm up}=$ 38 K. Another transition with $E_{\\rm up}=46 $ K is found\nin Class I disks: IRAS-04302, L1489, and TMC1A. In B1-c, the emission is marginally\nresolved, while in IRAS-04302 the molecule is clearly seen across the\nmidplane, indicating sublimation from icy grains at temperatures of at least 20 K\n\\citep{vantHoff2020b,Podio2020}. \n\n\nH$_2$CCO is detected for B1-c and S68N. For the lower $E_{\\rm up}=100$~K transition, the molecule is also detected in the outflow. For Class I sources, the transition at comparable energy is not detected. HCOOH is detected for B1-c and S68N with low-energy transitions that are seen both on source and in the outflow, while the higher energy line ($E_{\\rm up}=83$~K) is seen only on source. H$^{13}$CN is detected in B1-c and L1448-mm on source, additionally to the outflow component.\n\n\n\nDisks are commonly observed in Class I sources \\citep{Harsono2014,Yen2017}, as the envelope clears out. Fig. \\ref{fig:disks_no1_v1} presents maps of\nthe C$^{17}$O 2--1 ($E_{\\rm up}=$ 16 K) and CN 2--1 ($E_{\\rm up}=$16\nK) lines toward Class I disks and L1527-IRS, which is identified as a Class 0\/I object, observed with ALMA 12m at 0\\farcs3\nresolution. The C$^{17}$O and H$_2$CO emission for disks in Taurus\nusing these data are analyzed in detail by \\cite{vantHoff2020b}. Here\n we discuss CN in comparison with C$^{17}$O. C$^{17}$O is observed concentrated towards the continuum emission for all disks, and is a much cleaner tracer of the disk than any other more\nabundant CO isotopologues, although even C$^{17}$O still shows some trace\nemission from the surrounding envelope. \n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={0cm 0cm 0cm 0cm},draft=False]\n\n{plots\/fig11.jpeg}\n \\caption{Summary cartoon presenting key molecular tracers of different components, limited to molecules presented in this work except for NH$_3$ and N$_2$H$^{+}$ which are important large scale envelope tracers. CN molecule is shown on top of the disk as it traces the disk atmosphere and not the midplane. Protostar indicated in the center in yellow.} \n \\label{fig:cartoon_summary}\n\\end{figure*}\n\n\\section{Discussion}\n\\label{section:discussion}\n\n\nFigure \\ref{fig:cartoon_summary} summarizes current understanding about which molecule traces which component in Class 0\/I protostars. Table \\ref{table:table_components_mols}\n lists all molecules discussed in this work with indication of the physical component that they trace. Below, we will address several implications of the results. We note that the discussion is confined to the molecules targeted and detected in our datasets, but is by no means complete. Other relevant tracers not discussed here are NH$_3$ and N$_2$H$^{+}$, which are tracing the envelope well \\citep[e.g.,][]{Tobin2011, Chen2007}. PO and PN have been recently suggested as a cavity walls or outflow tracers, but have very low abundances \\citep{Bergner2019}. SO$_2$ is an important tracer of the warm gas in the disk-envelope interface \\citep{ArturV2019}. Finally, this work focuses on low-energy transitions observed with ALMA $E_{\\rm up} <$100 K with the exception for hot core tracers.\n \n\\input{table_components.tex}\n\n\n\\subsection{Cold envelope}\n\n\n\\subsubsection{C$^{18}$O}\n\nC$^{18}$O is a good tracer of high column density material because of its low critical density. However, it becomes less abundant as soon as the dust temperature drops below the CO freeze-out temperature ($\\sim$ 20--25 K). There is also a density threshold: CO freeze-out only occurs at densities above $\\sim 10^4$--$10^5$ cm$^{-3}$, because at lower densities the timescales for freeze-out are longer than the lifetime of the core \\citep{Caselli1999,Jorgensen2005a}. \n\n\nFor 4 out of 6 sources presented here at 6\\arcsec\\ resolution, \\cite{Kristensen2012} performed modeling of the SED and sub-mm spatial extent using the DUSTY code \\citep{Ivezic1997}. The results provide, among other properties, a temperature structure throughout the envelope and the radius at which the temperature drops below 10 K, which is considered as the border between envelope and the parent cloud. \\cite{Kristensen2012} obtained radii of 3800, 5000, 6700, and 9900 au for IRAS4B, TMC1, SMM3, and BHR71, respectively. The compact C$^{18}$O emission observed on-source and its\nnon-detection over the full expected extent of the protostellar\nenvelope can be explained by CO freeze-out occurring already within\nthe inner 1800 -- 2500 au radius, which is the spatial resolution\nof our observations for Class 0 sources. This upper limit on the CO\nsnowline is consistent with CO snowlines typically observed and\nmodeled toward other Class 0 protostars \\citep{Jorgensen2004d,\n Anderl2016, Hsieh2019}. \n\nEquation 1 from \\cite{Frimann2017} allows to calculate the expected CO snow\nline for the current luminosity of the example sources B1-c and TMC1\npresented in Fig. \\ref{fig:envelope_plot_no1_v1} in the absence of an\noutburst. For B1-c the snowline is expected to be at\n200--400 au radius depending on the assumptions of the sublimation\ntemperature (larger radii for 21 K and smaller for 28 K), while the\nTMC1 CO snowline is expected to be at 100--200 au. For the most luminous \nsource with C$^{18}$O 7m observations available, the expected radius\nis at 400--750 au. Therefore clearly in all cases the expected\nCO snowline is well within the 7m beam. In high-resolution studies, the CO emission is often\nseen at greater distances than expected from the current luminosities\nof those protostars. This is attributed to accretion bursts of\nmaterial which increase their luminosities resulting in a shift of the\nobserved CO emission radius up to a few times its expected\nvalue (but usually still within a 1000 au radius)\n\\citep{Jorgensen2015, Frimann2017,Hsieh2019}. \n\n\\subsubsection{N$_2$D$^+$ and DCO$^{+}$}\n\nBoth DCO$^{+}$ and N$_2$D$^+$ are considered cold gas\ntracers \\citep[e.g.,][]{Qi2015}. N$_2$D$^{+}$ is efficiently destroyed by CO in the gas-phase,\ntherefore freeze-out of CO results in N$_2$D$^+$ being retained in the\ngas-phase at larger radii of the envelope, where temperatures are\nlower. This behaviour has been demonstrated in several other protostellar sources by \\cite{Tobin2011,Tobin2013,Tobin2019}.\n\n\n\nBoth DCO$^+$ and N$_2$D$^+$ are produced through reactions with H$_2$D$^ +$. At cold\ntemperatures the H$_2$D$^+$ abundance is enhanced through the\nH$_3^+$ + HD $\\rightarrow$ H$_2$D$^+$ + H$_2$ reaction, which is exothermic by\n230 K. As the reverse reaction is endothermic, low temperatures\nincrease H$_2$D$^+$. Additionally, both H$_3^+$ and\nH$_2$D$^+$ are enhanced in gas where CO has been depleted. However, the CO\nmolecule is still needed for the production of DCO$^+$ through the\nH$_2$D$^+$ + CO reaction. Therefore, DCO$^{+}$ is expected to be most\nabundant around the CO snowline \\citep{Jorgensen2004d,Mathews2013}.\nWarmer production routes through CH$_2$D$^+$ + CO are also possible\n\\citep{Wootten1987, Favre2015, Carney2018}.\n\nThe difference between DCO$^{+}$ and N$_2$D$^{+}$ chemistry is reflected in morphology of both molecules in the dense regions close to the continuum peak. As DCO$^+$ requires gas-phase CO for its formation, it peaks close to the CO snowline, which is within the resolution of our observations ($\\sim$1800--2500 au radius), while N$_2$D$^+$ is only located where CO is not present in the gas phase. Therefore we observe a significant decrease of N$_2$D$^+$ in the inner envelope. If the warm production of DCO$^+$ is triggered in the inner regions, this will additionally produce DCO$^+$ within the beam of our observations, hence DCO$^+$ does not decrease in the inner envelope. The extent of the DCO$^+$ and N$_2$D$^+$ emission in each source is comparable, ranging from $\\sim$ 5000 au in B1-c and BHR71 to 1500 au in TMC1, suggesting that their outside radii trace the region where CO becomes present again in the gas phase due to the low density.\n \nThe morphology of the emission from cold gas tracers such as DCO$^{+}$ and N$_2$D$^+$ is sensitive to the density and temperature profile of the system, which can be affected by system geometry (i.e., outflow opening angle, disk flaring angle, flattening of the envelope). DCO$^{+}$ has been shown to increase its abundance in the cold shadows of a large embedded disk \\citep{Murillo2015}. Emission from DCO$^{+}$ and N$_2$D$+$ is consistent with a picture of a dissipating envelope in Class I sources, resulting in less dense, warmer gas surrounding the protostar. TMC1 has an order of magnitude lower envelope mass compared to the Class 0 sources (Table \\ref{table:targets}; \\citealt{Kristensen2012}). This causes the extent of the cold and dense region to shrink, preventing N$_2$D$^+$ from being detected, and limiting the extent of DCO$^+$ emission. The dense gas toward TMC1 is clearly present only in the flattened structure surrounding the binary system, likely forming a young, embedded disk. In fact this source is suggested to have a rotationally-supported circumbinary disk \\citep{Harsono2014, vantHoff2020b}. The geometry of the disk can create favourable conditions for the DCO$^+$ enhancement in the cold shadows of the disk.\n\n\nOther relevant molecules that trace the quiescent envelope material but are not presented here are HCO$^+$ and H$^{13}$CO$^+$ (\\citealt{Hogerheijde1997, Jorgensen2007, Hsieh2019}, van 't Hoff et al. in prep.). These molecules have been shown to probe the material outside of the water snowline \\citep{Jorgensen2013,vantHoff2018}. As water sublimates at temperatures $\\sim 100 $ K, much higher than CO, HCO$^+$ can be seen throughout the envelope, except for the warmest inner regions. N$_2$H$^+$ is tracing the envelope material and CO snowline and has been shown to peak closer to the central protostar than N$_2$D$^+$ \\citep{Tobin2013}. Their ratio can potentially be used as an evolutionary tracer of protostars \\citep{Emprechtinger2009}. NH$_3$ is also observed to map similar components as N$_2$H$^+$ \\citep{Tobin2019}. \n\nIn summary, the quiescent envelope material is traced by dense and\/or cold gas tracers. Chemical interactions result in N$_2$D$^+$ tracing the outer envelope where CO is frozen-out, whereas DCO$^{+}$ is seen both in the outer envelope as well as in the inner regions, tracing the unresolved CO snowline. C$^{18}$O is a good tracer of dense ($n$ $> 10^5$ cm$^{-3}$) and warm ( $T$ $>$ 30 K) regions in the inner 2000 au radius of the protostellar systems. The evolution of the physical conditions from Class 0 to Class I is evident as the envelope becomes less dense and the protostellar luminosity can heat up dust and gas more easily. \n\n\n\\subsection{Outflows and jets}\n\nOutflowing material from protostellar systems is best analyzed with kinematic information. In the following section, we will discuss three different componfents of protostellar outflows observed with the ALMA 12m array: 1) the high-velocity jet (\\textgreater 30 km s$^{-1}$), 2) the low-velocity outflow (\\textless 30 km s$^{-1}$), 3) the gas that results from the interaction with the outflow -- ice sputtering products at velocities close to that of ambient material, but with linewidths significantly broader (up to 15 km s$^{-1}$) than the quiescent envelope tracers. The three components are presented in Fig. \\ref{fig:outflow_showcase_no1} with examples of S68N, a representative case of a prominent outflow and ice sputtering, and L1448-mm, a source with a prototypical high-velocity jet.\n \n\\subsubsection{Extremely high-velocity (EHV) jet}\n\\label{section:extremely_high}\n\nThere are 6 out of 7 Class 0 sources targeted at high-resolution strengthen the conclusion that EHV jets are more common\nthan previously thought in Class 0 sources \\citep[][]{Podio2021}. It is argued that the molecular jet tracers have a very different physical origin than the protostellar outflows; contrary to the low-velocity outflow, which consists mostly of entrained envelope material, the EHV jet is expected to be directly launched from the innermost region of the system \\citep{Tafalla2010, Lee2020}. The high-velocity jet is comprised of atomic material which readily forms molecules in the high-density clumps \\citep[internal working surfaces;][]{Raga1990, Santiago-Garcia2009} that are resulting from shocks in the jet, which are produced by the velocity variations of the ejection. This in turn means that by observing the high-velocity bullets, one gains insight on the variability of the accretion process \\citep{Raga1990,Stone1993}. The new EHV sources B1c and SMM3 show bullet spacings of 1200 au in B1c and 3200 au in SMM3, which can be converted using the terminal velocity of the jets (not corrected for inclination) to the dynamical ages of 80 and 250 years, respectively. If the central mass of the protostar can be estimated this can be used to provide the orbital period of the component causing the variability \\citep{Lee2020}.\n\n\nThe fact that the EHV jet tracers are dominated by O-bearing molecules has been associated with a low C\/O ratio in the jet material \\citep{Tafalla2010}. For high mass-loss rates, molecules are produced efficiently in the jet from the launched atomic material \\citep{Glassgold1991, Raga2005, Tabone2020a}. Additionally the ratio of SiO-to-CO can indicate the presence of dust in the launched material, which can in turn inform about the jet launching radius, i.e., whether it is inside or outside the dust sublimation radius \\citep{Tabone2020a}. The new detections of high-velocity jets suggest that this process may be occurring in every young Class 0 object. Studying large samples of objects with ALMA and combining with multi-transition observations can unveil the atomic abundances of the inner regions, which are difficult to measure otherwise directly \\citep{McClure2019}. \n\nThe presence of H$_2$CO in the jet could result from gas-phase production through the reaction of CH$_3$ with O. Alternatively, if the icy grains were launched with the jet, they could be sputtered in the internal working surfaces at high velocities \\citep{Tychoniec2019}.\n\nIn summary: O-bearing species such as CO, SiO, SO, and H$_2$CO observed at high velocities are excellent tracers of the chemistry within the protostellar jet. Those molecules most likely formed in the internal working surfaces from the material carried away from the launching region of the jet.\n\n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.95\\linewidth,trim={0cm 0cm 0cm 0cm}]\n {plots\/fig12.jpeg}\n \\caption{Maps of three different components of the outflow. Moment 0 maps are presented in color scale with continuum emission at 1.3 mm in black contours, both obtained with ALMA 12m observations. \n {\\it Left:} An extremely high-velocity (EHV) molecular jet illustrated with the SiO (4--3) map for L1448-mm integrated from -70 to -50 and from 50 to 70 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $.\n {\\it Middle:} Low-velocity outflow illustrated with the CO 2--1 map for S68N integrated from -15 to -3 and from 3 to 15 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $. {\\it Right:} Ice mantle content released with shock sputtering presented with the CH$_3$OH (2$_{1,0}$ -- 1$_{0,0}$) map for S68N integrated from -8 to -1 and from 1 to 8 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $. The CO outflow from Ser-emb-8N is present at the edge of the map.}\n \\label{fig:outflow_showcase_no1}\n\\end{figure*}\n\n\\subsubsection{Low-velocity outflow}\n\\label{section:low-velocity_outflow}\n\nThe CO molecule traces the bulk of the gas as it is the most abundant molecule detectable in the sub-mm regime. It serves as an indicator of the outflow extent and gas morphology, as it is not affected by chemical processing in shocks. It can also be used to quantify the total mass-loss rates, using the dense cloud abundance ratio of CO\/H$_2$ $\\sim$ 10$^{-4}$. A well-known correlation between molecular outflows and protostellar luminosities indicates a strong link between the accretion and ejection processes \\citep{Cabrit1992, Bontemps1996, Mottram2017}. The decrease in accretion and total envelope mass with evolution of the system also results in fainter, less powerful outflows. The weak emission from the Class I source TMC1, which is an order of magnitude lower in intensity with respect to outflows from Class 0 protostars, is consistent with this trend.\n\n\n\nSiO is a molecule that is enhanced by several orders of magnitude in shocks compared with gas in cold and dense clouds where most of the Si is locked in the grains \\citep[e.g.,][]{Guilloteau1992, Dutrey1997}. Shocks release Si atoms from the grains by means of sputtering and grain destruction, leading to subsequent reactions with OH, another product of shocks, forming SiO \\citep{Caselli1997,Schilke1997,Gusdorf2008,Gusdorf2008a}. Thus, SiO is much more prominent in high-velocity gas, where grains are more efficiently destroyed (see Section \\ref{section:extremely_high}), than in low-velocity shocks.\n\nSO is enhanced in shocks through reactions of atomic S released from the grains with OH, as well as through H$_2$S converted to SO with atomic oxygen and OH \\citep{Hartquist1980,Millar1993}. Shocks could also explain the emission toward TMC1, where weak accretion shocks onto the disk could enhance the SO abundances \\citep{Sakai2014a,Yen2014, Podio2015}.\nOverall, there is a clear decrease of both SiO and SO low-velocity\nemission from Class 0 to Class I. Either the less powerful jet cannot\ndestroy the grains and create conditions for the production of SiO and\nSO and\/or the much less dense envelope and outflow cavity walls do not\nprovide enough dust grains for creating large column densities of those\nmolecules; additionally, the excitation conditions might change significantly\n with evolution of the protostellar system, hampering the\ndetection of even low-$J$ SO and SiO transitions with critical\ndensities in the $10^5-10^6$ cm$^{-3}$ range.\n\nHCN is associated with the most energetic outflows \\citep{Jorgensen2004, Walker-Smith2014} and is enhanced at high temperatures in shocks. H$^{13}$CN is likely associated with both the hot inner regions (not detected in HCN due to optical thickness of the line) and the low-velocity outflow \\citep{Tychoniec2019, Yang2020}. The geometry of H$^{13}$CN emission seen in HH211 resembles a cavity wall: it could be a result of CN produced by UV-photodissociation and subsequent production of HCN via the H$_2$ + CN reaction, which requires high temperatures \\citep{Bruderer2009,Visser2018}. The fact that H$^{13}$CN is seen at outflow velocities shows that shocks are required to produce HCN, which is likely released at the cavity walls and then dragged with the outflow.\n\n\n\n\n\n\n\n\\subsubsection{Shock sputtering products}\n\\label{section:shock_sputtering}\n\nIce-mantle tracers are detected in outflows of SMM3, B1-c and S68N protostars. As indicated in Section \\ref{section:results_outflows} S68N is the best test-case to study the composition of shock-released ice mantles. The morphology of the emission of ice-mantle tracers in S68N is somewhat uniform. CH$_3$CN and HNCO are clearly brighter on the redshifted part of the outflow (south-east) and CH$_3$CHO are brighter in the blueshifted (north-west) side. CH$_3$OH and H$_2$CO show an even distribution between the two lobes. The peak intensity for all species occurs at significant distances from the source ($\\sim$ 5000 au) and in some cases the emission drops below the detection limit closer to the source. This is contrary to the CO emission, which can be traced all the way back to the central source. In all tracers the emission is also detected at the continuum position, however, this emission has a narrow profile and results from thermal sublimation of ices in the hot core of S68N \\citep{vanGelder2020}.\n\nThe velocities observed for CH$_3$OH and other ice-mantle tracers are high enough for these molecules to be material near the outflow cavity walls, where ice mantles could be sputtered. These molecules therefore most likely trace low-velocity entrained material with a considerable population of ice-coated grains that are sputtered in the shock \\citep{Tielens1994,Buckle2002, Arce2008, JimenezSerra2008, Burkhardt2016}. Thermal desorption of molecules from grains is not likely as dust temperatures at distances of few times 10$^3$ au from the protostar are well below the desorption temperatures for most COMs. The fact that there is no enhancement of these tracers closer to the source also argues against emission being related to high temperature. \n\n\n\\subsection{Outflow cavity walls}\n\\label{section:outflow_cavity_walls}\n\n\nEmission from hydrocarbons and CN in the outflow cavity walls is directly related to the exposure of those regions to the UV radiation from the accreting protostar. Both c-C$_3$H$_2$ and C$_2$H have been prominently observed in PDRs such as the Horsehead Nebula and the Orion Bar tracing the layers of the cloud where UV-radiation photodissociates molecules, which helps to maintain high atomic carbon abundance in the gas-phase that is needed to build these molecules. C$_2$H is enhanced in the presence of UV radiation at cloud densities \\citep{Fuente1993, Hogerheijde1995} and c-C$_3$H$_2$ usually shows a good correlation with C$_2$H \\citep{Teyssier2004}. Both molecules have efficient formation routes involving C and C$^+$, although models with only PDR chemistry tend to underpredict their abundances, especially for c-C$_3$H$_2$. A proposed additional mechanism is the top-down destruction of PAHs \\citep{Teyssier2004, Pety2005, Pety2012, Guzman2015}; the spatial coincidence of PAH emission bands with hydrocarbons in PDRs is consistent with that interpretation \\citep{vanderWiel2009}. \n\nIt is instructive to compare the conditions between classic PDRs and outflow cavity walls around low-mass protostars.The $G_0$ value for Orion Bar is estimated at 2.6 $\\times$ 10$^4$ \\citep {Marconi1998}, while the Horsehead Nebula has a much more moderate radiation field of $~ 10^2$ \\citep{Abergel2003}. The UV radiation field around low-mass protostars measured by various tracers is 10$^2$--10$^3$ at $\\sim$ 1000 au from the protostar \\citep{Benz2016, Yildiz2015, Karska2018}, therefore the PDR origin of small hydrocarbons is plausible. The top-down production of hydrocarbons due to PAHs destruction does not appear to be an efficient route here, as PAHs are not commonly observed in low-mass protostellar systems \\citep{Geers2009}, and the UV-fields required for this process are above 10$^3$ \\citep{Abergel2003}.\n\nThe difference in morphology of hydrocarbons between Class 0 and Class I systems -- outflow cavity walls in Class 0 versus rotating disk-like structure in Class I -- is most likely related to the evolution of the protostellar systems. Class 0 sources have a dense envelope and the UV radiation can only penetrate the exposed outflow cavity walls, while for Class I it is likely much easier for both the UV radiation from the accreting protostar and the interstellar radiation to reach deeper into the envelope or disk. This is consistent with emission from well-defined cavity walls seen toward those sources.\n\n\n\nThe case of moderate $\\sim 10$ km s$^{-1}$ velocity material observed\ntoward S68N indicates that the C$_2$H line does not in all sources\ntrace exclusively the quiescent cavity walls. The profile is consistent with the\nobserved morphology of the line (see Fig. \\ref{fig:hydrocarbons_no2}) -- emission is seen up to a few thousand au from the source and its shape does not resemble a\ncavity wall as clearly as in other sources. The narrow component centered at systemic velocity seen\nin Fig. \\ref{fig:spectra_coms_outflow_no1} indicates that while the broad\ncomponent might be dominating the emission, the UV-irradiated cavity\nwall also contributes to the emission observed for S68N. \n\nS68N could be a very young source, as the chaotic structure of its\noutflow and envelope indicates \\citep{LeGouellec2019}. The high\nabundances of freshly released ice-mantle components described in\nSection \\ref{section:shock_sputtering} are consistent with this interpretation. It is also\npossible that UV radiation produced locally in shocks is causing the\nenhancement of C$_2$H emission at higher velocities.\n\nThe $^{13}$CS molecule, as a high-density tracer likely traces the material piling up on the cavity walls pushed by the outflow. This emission is usually slow ($\\pm$ 2 km s$^{-1}$ ) indicating that this is not outflowing gas but rather envelope material on the outflowing cavity walls. The non-detection of $^{13}$CS in 12m data (Fig. \\ref{fig:hydrocarbons_no2}) towards the Class I source TMC1 is consistent with the dissipating envelope as the source evolves, hence no high-density material is seen in the remnant cavity walls, even though they are still highlighted by the CO emission. In the remaining Class 0 sources with the $^{13}$CS detections -- Emb8N, SMM1 and S68N (Fig. \\ref{fig:fig_E2}), -- emission also follows other cavity wall tracers. SMM1 is the only source that shows higher velocity structure (> 7 km s$^{-1}$) of the $^{13}$CS emission on one side of the cavity wall. As this is spatially coincident with the high-velocity jet observed in CO \\citep{Hull2016}, this emission might be related to the material released with the jet from the envelope. \n\n\nTo summarize, we observe the hydrocarbons C$_2$H and c-C$_3$H$_2$, as\nwell as CN, H$^{13}$CO${^+}$ and $^{13}$CS in the outflow cavity walls\nof Class 0 protostars. C$_2$H, as the most abundant of the hydrocarbons presented here, is also seen prominently across the envelope at\nvelocities comparable to the low-velocity outflow whereas c-C$_3$H$_2$ appears as a clean tracer of the quiescent, UV-irradiated gas in the cavity walls in the Class 0 sources.\n\n\n\\subsection{Warm inner envelope}\n\n\\subsubsection{Compact emission}\n\\label{section:compact_emission}\n\n\n\nThe inner regions of young protostellar systems are characterized by\nhigh temperatures which result in a rich chemistry as molecules that\nform efficiently in ices on grains in cold clouds sublimate into the\ngas phase. Complex organic molecules (COMs) detected in these\ndatasets are discussed quantitatively in detail elsewhere, for both\nO-bearing by \\cite{vanGelder2020} and for N-bearing species by \\citep{Nazari2021} In this section we focus on smaller molecules that also\ntrace the innermost hot core regions and therefore are likely abundant in ices. This includes several small S-bearing molecules.\n\n\n\n\nBoth B1-c and S68N are sources characterized as hot cores\n\\citep{Bergner2017, vanGelder2020}, which means that the conditions in\ntheir inner regions are favourable for release of molecules from the\nice mantles. For the well-studied case of IRAS16293-2422,\n\\cite{Drozdovskaya2018} have also identified a hot core component of\nSO based on isotopologue data, in addition to an SO component in the large scale outflow. Overall, SO observed in protostars appears to be related mostly to evaporation of grain mantle.\n\nThe SO appearance close to the central protostar could be related to accretion shocks onto the disk, which are weaker than shocks that cause the SO emission seen in the outflows (Section 4); in accretion shocks, SO can be released from the icy mantles with the infalling material \\citep{Sakai2014a}. However, narrow linewidths of SO toward TMC1 seem to rule out the accretion shock scenario, and points to emission along the cavity walls \\citep{Harsono2020}.\n\nHNCO emission has been modeled by \\cite{HernandezGomez2018} and suggested to be a superposition of both warm inner regions of the envelope as well as the colder, outer envelope. Its similar behaviour to sulphur-bearing species, also observed in our work, is proposed to be related to the fact that O$_2$ and OH are involved in formation of species like SO and HNCO \\citep{RodriguezFernandez2010}. \n\n\nH$_2$S is expected to be the dominant sulphur carrier in\nices \\citep{Taquet2020}. However, it has not yet been detected in ice absorption spectra\nto date \\citep{Boogert2015}. The weak emission from H$_2$S in dark\nclouds has been modeled as a result of the photodesorption of ices at\nthe outside of the cloud (like in the case of H$_2$O,\n\\citealt{Caselli2012b}), while chemical desorption is important for\ngrains deeper inside the cloud but outside the water snowline\n\\citep{NavarroAlmaida2020}. These models are consistent with \nH$_2$S ice containing most of the sulphur. \nMultiple lines of H$_2$CS are a\npowerful tool to probe the warm > 100 K, innermost regions of the\nprotostellar systems \\citep{vantHoff2020a}. \n\n\n\n\nWhile B1-c and S68N are characterized as hot cores with many COM lines detected \\citep[][]{vanGelder2020}, and L1448-mm has warm water in the inner regions \\citep{Codella2010}, SMM3 does not appear to have significant emission from COMs. Moreover, simple molecules associated with the hot cores for B1-c, such as SO and H$_2$CO, are only seen outside of the SMM3 central source. While it is possible that the optically thick continuum prevents a detection of COMs in its inner envelope \\citep{DeSimone2020}, differences in chemistry or physical structure (e.g., a large cold disk, see Section \\ref{section:results_inner_env}) between the SMM3 and the hot core sources are also possible.\nThe fact that emission from OCS and H$_2$S is centrally peaked (Fig. \\ref{fig:hotcore_v1}, bottom row) suggests that continuum optical depth is not an issue, although both those species could be a result of grain destruction or ices sputtering, therefore not necessarily coming from the midplane but rather from the surface of a disk-like structure. The additional detection of CCS in 7 data towards SMM3, which is on the other hand not detected in B1-c could hint at different chemical composition of the two protostellar systems. \n\n\n\n\n\n\n\n \n\n\\subsubsection{Embedded disks}\n\nIn the case of large edge-on\ndisks like IRAS-04302 and L1527, the vertical structure of the emission can be\nprobed, as well as the radius where CO freeze-out occurs. Overall,\nClass I disks are warmer than their Class II counterparts with CO freeze-out taking place only in the\noutermost regions \\citep{Harsono2015,vantHoff2018,vantHoff2020b,Zhang2020}.\n\n\n\nWe detect CN in all observed Class I disks, although it does not trace the midplane of the disk. In the near edge-on example of IRAS-04302, the CN emission originates from the upper layers of the disks, in the same direction as the outflow, which is perpendicular to the disk in this source. This opens a possibility that the emission is also related to the irradiated residual cavity walls in those sources. TMC1A is a clear example where CN is tracing the same material as probed by \\cite{Bjerkeli2016} in CO, which is attributed to a disk wind. TMC1 and L1527 show CN oriented in the same direction as the disk; in TMC1 there is also a clear filament structure on larger scales irradiated by the UV from the protostar, seen also in other tracers.\n\nIn comparison with the C$^{17}$O emission, which traces the midplane disk, CN thus appears in the upper layers and in the outflow, therefore in most cases the two molecules are mutually exclusive. This picture is consistent with the bulk density traced by CO and the irradiated layers of the disk and envelope exposed to UV traced by CN. Recent observations of a sample of Class I sources including IRAS-04302 by \\cite{Garufi2020} is consistent with CN not tracing the disk midplane.\n\nIn the younger Class 0 or borderline Class 0\/I sources characterization of the disk is much more difficult because of the strong envelope emission. Nevertheless, several Keplerian disks have been identified with observations of CO\nisotopologues like C$^{18}$O and $^{13}$CO\n\\citep{Tobin2012,Murillo2013}.\nOur data allow us to investigate this for the case of SMM3. Fig. \\ref{fig:smm3_disk} shows the red and blue-shifted emission from C$^{18}$O toward SMM3. There is a clear rotational signature in the direction perpendicular to the outflow on scales of a few hundred au. However, to unambiguously identify the disk and its radius, higher spatial and spectral resolution data are necessary. \n\n\n\n\\begin{figure*}[h]\n\\centering\n \\includegraphics[width=0.99\\linewidth,trim={1cm 0cm 0cm 0cm}]\n \n {plots\/fig13.jpeg}\n \\caption{Ratio of complex organic molecules with respect to CH$_3$OH in S68N. The ratios are shown for a 3\\arcsec\\ region in both redshifted and blueshifted part of the outflow. The abundance ratios in the hot cores are taken from \\cite{vanGelder2020} and \\cite{Nazari2021}. The errorbars mark the lower and upper limit on the ratios, as calculated from the optically thick CH$_3$OH emission (lower limit) and $^{13}$CH$_3$OH (upper limit). All outflow abundances obtained from the Band 6 data at 0\\farcs45 resolution except for CH$_3$OCHO and CH$_3$CN which were derived from Band 3 data at 3\\arcsec. } \n \\label{fig:barplot}\n\\end{figure*}\n\n\n\n\n\\subsection{COMs in outflow versus hot core}\n\nThe complex organic molecules are already detected in the prestellar stage of star formation \\citep{Bacmann2012, Scibelli2020}, where they are efficiently produced on the surfaces of icy grains \\citep[e.g.,][]{Watanabe2004,Oberg2009}. COMs can be subsequently released back into the gas through various non-thermal desorption processes and\/or be re-formed by gas-phase reactions. In the inner envelope, temperatures are high enough that thermal desorption of ices is enabled. In the outflow cavity walls, sputtering by shocks can release ices from the grains. In the hot core, COMs are detected through high excitation lines, while in the outflow, they are observed primarily through transitions with low $E_{\\rm up}$. Therefore, comparing the observations of molecular complexity in outflows with hot cores can unveil if there is any warm temperature processing of the ices and whether some molecules also have a gas-phase production route. \n\n\n\n\nTherefore, we compare abundance ratios between different ice\nmantle species and methanol at three positions for S68N: one on\nthe source, obtained from \\cite{vanGelder2020} and \\cite{Nazari2021}, and\none each in the blueshifted and redshifted part of the outflow, which are calculated from the fluxes obtained in this work. We\nmeasure the abundance of the species in a 3\\arcsec\\ region centered on\nCH$_3$OH peak on the blueshifted and redshifted regions. The size of the\nregion is based on the spatial resolution of the Band 3 data. The regions are\nindicated in Fig. \\ref{fig:icemantle_no1}. From these regions, we extracted spectra and calculated column densities using the spectral analysis tool CASSIS \\footnote{http:\/\/cassis.irap.omp.eu\/}.\n\nFor the CASSIS model, we assume $T_{\\rm ex}$ = 20 K, typical of subthermally excited molecules with large dipole moments in outflow gas. The FWHM of the lines was fixed at 3 km s$^{-1}$, which is the width of the CH$_3$OH line. With those parameters, an LTE calculation provides column densities for the observed line intensities under the assumption of optically thin emission (see \\cite{Tychoniec2019} for a discussion on uncertainties in this method.)\n\n\nOnly a single CH$_3$OH line 2$_{1,0}$--1$_{0,1}$ ($E_{\\rm up}$ = 28 K) is detected in the outflow of S68N. Escape probability calculations with RADEX \\citep{Tak2007} show that even at the lower densities in outflows this CH$_3$OH line is likely optically thick. No optically thin CH$_3$OH isotopologue is detected in the outflow; therefore, we provide an upper limit for the $^{13}$CH$_3$OH 2$_{1,1}$-1$_{0,1}$ ($E_{\\rm up}=$28 K). The upper limit on this $^{13}$CH$_3$OH line of $1\\times 10^{14}$ cm$^{-2}$ translates to an upper limit on the CH$_3$OH column density of $7\\times 10^{15}$ cm$^{-2}$ assuming $^{12}$C \/ $^{13}$C = 70 \\citep{Milam2005}. \n\n\nThe column density calculated from the flux measurement of the CH$_3$OH line gives of $2\\times 10^{15}$ cm$^{-2}$; thus, the methanol abundance can be underestimated by a factor of 4. With the information available, we assume that the CH$_3$OH column density is between $2\\times 10^{15}$ cm$^{-2}$ and $7\\times 10^{15}$ cm$^{-2}$ and we compare abundances of other molecules with respect to CH$_3$OH using this range of values. The hot core methanol column density of S68N in \\cite{vanGelder2020} is corrected for optical thickness with CH$_3^{18}$OH. \n\n\n\n\n\n\nFigure \\ref{fig:barplot} compares the abundance ratios of various species with respect to methanol for S68N. First, it shows that the relative abundances are remarkably similar on both sides of the outflow, well within the uncertainties. Second, most abundances relative to CH$_3$OH are found to be comparable to the S68N hot core within our uncertainties and those of\n\\cite{vanGelder2020} and \\cite{Nazari2021}, noting that due to lack of optically thin CH$_3$OH line detected in the outflow, our uncertainties are larger. The greatest difference is seen for CH$_3$CHO and H$_2$CCO, which could be attributed to the additional gas-phase formation in shocks. While the difference is well beyond the conservative uncertainties assumed here, this result should be confirmed with a larger sample of sources with different properties. The jump in CH$_3$CHO abundance with respect to methanol in the outflow has been also reported for two other sources - L1157 and IRAS4A \\citep{DeSimone2020b}.\n\nFor the well-studied L1157 outflow, \\cite{Codella2020} find\nCH$_3$CHO\/CH$_3$OH is 0.5\\%. which they find in agreement with ratios\nin hot cores toward different protostars, but not including L1157\nitself. In the case of S68N we uniquely show a comparison between the\nemission from molecules in the outflows and hot core for the same\nsource. While modeling by \\cite{Codella2020} shows that the similar\nspatial origin of CH$_3$OH and CH$_3$CHO does not imply that they are\nboth solely grain sputtering products, an agreement between hot cores\nand outflows could mean that similar processes are responsible for\nemission in both regions. \n\n\nIt is interesting that the SMM3 outflow shows ice mantle tracers in\nthe outflow but not on the source. Thus, the lack of hot core\nemission is likely due to the physical conditions in the inner regions such as a large disk (Section \\ref{section:results_inner_env}) or\ncontinuum optical depth \\citep{DeSimone2020} and not to the lack of\ncomplex molecules on the grains. Since methanol is not detected, we cannot\nprovide abundance ratios for this outflow. B1-c - another source\nwith an outflow containing ice mantle products, has methanol lines\noverlapping with the high-velocity SO outflow, therefore precise\nabundance measurements are not possible.\n\n\n{\\it JWST} will be able to provide information on the ice content due\nto rich absorption spectra in the mid-IR. The abundances of COMs in\nthe gas-phase provided by ALMA \\citep{vanGelder2020,Nazari2021} can then be directly compared with the ice\ncontent. So far, the ice content observed on cloud scales with {\\it\n Spitzer} does not show a correlation with the gas content but those\ndata do not probe thermally desorbed ices \\citep{Perotti2020}.\n\n\n\\subsection{Carbon-chains and other hydrocarbons vs COMs}\n\nEarly observations at low spatial resolution suggested that large\ncarbon-chains such as C$_5$H, HC$_7$N, and HC$_9$N and complex organic\nmolecules are mutually exclusive, and therefore the two were proposed\nto be tracers of two different categories of protostellar sources\ndriven by different chemistry, namely warm carbon-chain chemistry\n(WCCC) and hot core chemistry \\citep{Sakai2013}. Warm carbon-chain\nchemistry is thought to occur above the sublimation temperature of CH$_4$ $\\sim$ at\n30 K. The proposed difference then lies in the WCCC sources\ncollapsing more rapidly than the hot core sources, which prevents CO\nto accumulate on the ices, leaving a higher CH$_4$ ice content. Thus,\nin WCCC sources, there would be less CO to form more complex organic\nmolecules such as CH$_3$OH, and an underabundance of COMs is indeed\nobserved. This scenario has been supported by the lower deuteration observed in\nWCCC sources \\citep{Sakai2009a}. With ALMA observations at\nhigher resolution and sensitivity, sources harboring both COMs and\nsmall hydrocarbons, c-C$_3$H$_2$, and C$_2$H, have now been observed\n\\citep{Imai2016, Oya2017}.\n\n\n \n\n\\begin{figure}[h]\n\\centering\n \\includegraphics[width=0.92\\linewidth,trim={0cm 0cm 0cm 0cm}]\n {plots\/fig14.jpeg}\n \\caption{Emission maps of an example COM and hydrocarbon toward B1-c. {\\it Left:} CH$_3$CHO moment 0 map, {\\it Right:} C$_2$H moment 0 map; both integrated from -2 to 2 km s$^{-1}$ w.r.t $\\varv_{\\rm sys} $.} \n \\label{fig:coms_vs_hydrocarbons}\n\\end{figure}\n\nOur data also show detection of small hydrocarbons and COMs in the\nsame sources (Fig. \\ref{fig:coms_vs_hydrocarbons}). However, our high resolution maps now show those\nhydrocarbons to originate in the UV irradiated outflow cavity walls\n(Section 6). Both c-C$_3$H$_2$ and C$_2$H can be solely explained by\nPDR chemistry \\citep{Guzman2015, Cuadrado2015} even in moderate UV\nfields of low-mass protostars and therefore WCCC chemistry does not\nneed to be invoked for the sources presented in this work. The PDR\norigin is consistent with our observed geometry\nat the edges of the cavities, where lower extinction allows the UV\nradiation from the protostellar accretion to easily reach this\nregion. It also explains the confinement of this emission to the inner\n2000 au of the envelope as the UV radiation decreases with distance\nfrom the source. A deep search for larger hydrocarbons like HC$_5$N in\ncavity walls could help to understand their origin.\n\n\n\n\n\\subsection{Class 0 vs Class I in different components}\n\n\nMany processes take place within the protostellar\nlifetime of a few $10^5$ yr that alter the chemical composition and\nphysical conditions. First, the envelope is dissipating, and the radius\nwhere key molecules are in the gas-phase is becoming smaller\n\\citep{Jorgensen2005a}. With high-resolution studies, it is possible\nto probe different snowlines in unprecedented detail now\n\\citep{vantHoff2018,Hsieh2019}. There is a clear evolutionary trend observed in temperature -- Class 0 disks are generally warmer than Class II disks, with Class I sources in between, which has major impact on the richness of their spectra \\citep{vantHoff2020b,vantHoff2020a}. This is also observed in our sample where all Class 0 show either complex organic molecules or small molecules related to grain evaporation but no evidence of those molecules is found in Class I sources (Section \\ref{section:compact_emission}). Table \\ref{table:evolution_summary} summarizes the evolution of the molecular composition of protostellar systems.\n\nComplex organic molecules are a key tracer of chemistry at the early stages. We see them in the outflows only in Class 0 sources, likely due to the decrease of the outflow force and mass and envelope density. In the inner regions, physical conditions such as temperature and density also favour the early stages for the abundances of COMs. In rare cases of rich chemistry in Class I disks, it is usually attributed to accretion outbursts heating up the disk \\citep{vantHoff2018c,Lee2019}. \n\nMolecular EHV jets are only present in the Class 0 phase \\citep{Nisini2015}. In our sample 6 out of 7 sources have high-velocity component and none is detected in Class I (Section \\ref{section:extremely_high}), whereas the lower velocity outflows in these stages are rich in ice mantle tracers (Section \\ref{section:shock_sputtering}). The Class I jets are invisible in molecular tracers, and their outflows show CO primarily, with much less contribution from shock tracers such as SO and SiO (Section \\ref{section:low-velocity_outflow}).\n\n\nCavity walls are seen prominently in the Class 0 sources in molecules\nwhose abundances are sensitive to UV radiation. In Class I sources, a\nflared disk and weak outflow remain. While there is less envelope to\nattenuate the UV radiation, there is also less material to irradiate and accretion luminosity of older sources decrease,\nwhich results in less prominent emission from UV tracers on large\nscales in Class I (Section \\ref{section:outflow_cavity_walls}). Another example of a transition of molecular appearance between Class 0 and I is SO: this molecule traces the outflow in Class 0 and the disk-envelope interface in Class I primarily. \n\n\n\n\n\n\\begin{table*}\n\\caption{Summary of evolution of chemical tracers} \n\\label{table:evolution_summary} \n\\centering \n\\begin{tabular}{p{2cm} p{7cm} p{7cm}} \n\\hline\\hline \nComponent & Class 0 & Class I \\\\\n\n\\hline \nEnvelope & Cold, dense envelope results in cold tracers (DCO$^+$, N$_2$H$^+$, N$_2$D$^+$) & Envelope dissipates, extent of cold tracers is much smaller \\\\\n\\hline\nJet & O-bearing molecules (CO, SiO, SO, H$_2$CO) are present in high-velocity bullets & Molecular jet disappears, seen only in atomic and ionised gas \\\\\n\\hline\nOutflow & Ice sputtering (CH$_3$OH, HNCO) and grain destruction (SO, SiO) tracers are present & Decreased outflow mass and less dense envelope result in no tracers of sputtering and grain destruction, only faint CO remains\\\\\n\\hline\nCavity walls & Prominent signs of UV-irradiated cavity walls (CN, C$_2$H, c-C$_3$H$_2$) & No prominent signs of hydrocarbons in cavity walls, CN still present \\\\\n\\hline\nHot core & COMs and simple tracers of ice sublimation and high-temperature chemistry (H$_2$S, OCS) & Small extent plus disk shadowing results in less complexity, except for outbursting sources\\\\\n\\hline\nDisk & Warm disk with COMs, dust obscuration & Colder disk molecules, Keplerian rotation seen in H$_2$CO, C$^{18}$O, CN in the disk surface.\\\\\n\n\\hline \n\n\\end{tabular}\n\\end{table*}\n\n\n\n \n\n\n\\section{Conclusions}\n\\label{section:conclusions}\n\nIn this work, we have presented an overview of the molecular tracers of the physical components in protostellar Class 0 and Class I systems. Table \\ref{table:table_components_mols} and Fig. \\ref{fig:cartoon_summary} present an overview of the results, which are summarized below. \n\n\\begin{itemize}\n\\item Protostellar envelopes are primarily traced with the dense gas tracers such as C$^{18}$O and CO, and snowline tracers such as DCO$^{+}$, N$_2$D$^+$, H$^{13}$CO$^+$. For this component, it is essential to use observations that are sensitive to large scales of $\\sim$ 5000 au.\n\n\\item Protostellar outflows are separated into different components. High-velocity molecular jets are traced by O-bearing molecules CO, SiO, SO, and H$_2$CO. Entrained outflow material can be probed by low-velocity CO, SiO, SO, H$_2$CO, HCN as well as molecules released from ices by sputtering, such as CH$_3$OH, CH$_3$CHO, HNCO, CH$_3$CN, and CH$_3$OCHO.\n\n\n\\item Outflow cavity walls are pronounced in UV irradiation tracers: C$_2$H, c-C$_3$H$_2$, and CN, and high-density tracers such as $^{13}$CS. \n\n\\item Hot cores, the inner warm envelopes, are probed predominantly by COMs and simple molecules released from ice mantles and produced by high-temperature chemistry such as SO, H$_2$S, H$_2$CS, OCS, H$^{13}$CN, HCOOH, and HNCO.\n\n\\item Embedded disks, which are most clearly seen in Class I sources, can be seen in C$^{17}$O and H$_2$CO while CN traces their upper layers. CO isotopologues can be used to probe disks in Class 0 sources. However, the confusion with the envelope emission requires a detailed analysis of the kinematics to confirm that a Keplerian disk is present. \n\n\\end{itemize}\n\nHydrocarbons and COMs are found to co-exist routinely in protostellar\nsources: the former are present in the UV-irradiated cavity walls and\nthe latter in the hot core and in the outflows. It is plausible that\nPDR chemistry for the formation of hydrocarbons is sufficient to\nexplain the presence of molecules such as C$_2$H and c-C$_3$H$_2$, and\nthat no warm carbon-chain chemistry is required, which relies on\nabundant CH$_4$ in ices. Observations of more complex carbon chains in\ncavity walls and envelopes are necessary to understand whether the WCCC\nplays a role there. {\\it JWST} will be able to probe the CH$_4$ ice\ncontent at spatial scales comparable to ALMA, which will show if there are any differences in the ice\ncomposition between sources.\n\nThroughout this study, the availability of both low-lying molecular\nlines to probe the cold extended envelope and outflow, as well as\nhigh-excitation lines to trace compact hot cores has been a key for the\nanalysis. The occurrence of the same molecules in different physical\ncomponents provides an opportunity to study the processes\ninvolved in their formation and excitation. For example, ice mantle\ntracers sputtered from the grains in outflows give useful insight on\nthe ice composition, whereas comparison with abundances of thermally\nreleased COMs in the inner region is a powerful tool to probe whether\ngas-phase formation routes contribute to complex molecules formation.\n\n{\\it JWST}-MIRI will provide unprecedented resolution and sensitivity\nin mid-IR that will allow probing the emission from hot gas in shocks\nas well as ice absorption features. {\\it JWST} observations can then be combined with our\nunderstanding of the kinematics and spatial origin of molecules\nrevealed by ALMA.\n\n{\\it Acknowledgements. }The authors are grateful to the anonymous referee for comments that improved the quality of the paper.\nThis paper makes use of the following ALMA data: ADS\/JAO.ALMA\\# 2017.1.01174.S, ADS\/JAO.ALMA\\# 2017.1.01350.S, ADS\/JAO.ALMA\\# 2017.1.01371.S, ADS\/JAO.ALMA\\# 2017.1.01413.S, ADS\/JAO.ALMA\\# 2013.1.00726.S, ADS\/JAO.ALMA\\# 2016.1.00710.S. ALMA is a partnership of ESO (representing its member states), NSF (USA) and NINS (Japan), together with NRC (Canada), MOST and ASIAA (Taiwan), and KASI (Republic of Korea), in co-operation with the Republic of Chile. The Joint ALMA Observatory is operated by ESO, AUI\/NRAO and NAOJ. Astrochemistry in Leiden is supported by the Netherlands Research School for Astronomy (NOVA). \u0141.T. acknowledges the ESO Fellowship Programme. M.L.vG. acknowledges support from the Dutch Research Council (NWO) with project number NWO TOP-1 614.001.751. C.L.H.H. acknowledges the support of the NAOJ Fellowship and JSPS KAKENHI grants 18K13586 and 20K14527. The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.\nThis research has made use of NASA's Astrophysics Data System Bibliographic Services. This research made use of NumPy \\citep{harris2020array}; Astroquery \\citep{2019AJ....157...98G}; Astropy, a community-developed core Python package for Astronomy \\citep{2018AJ....156..123A, 2013A&A...558A..33A}; Pandas \\citep{McKinney_2010, McKinney_2011}; and Matplotlib \\citep{Hunter2007}.\n\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\\label{sec:intro}\n\n\nThe existence of intergalactic magnetic fields has been speculated for nearly half a century \nlargely motivated by the observation of micro Gauss fields in galaxies and clusters of \ngalaxies~\\citep{1992ApJ...387..528K,2001ApJ...547L.111C,2008Natur.454..302B,2010A&A...513A..30B}.\nA primordial magnetic field can be a crucial ingredient for the formation \nof stars and galaxies~\\citep{Rees:1987} and its properties can open a window to\nthe early universe in the domain of very high energy particle \ninteractions of matter~\\citep{Vachaspati:1991nm,Vachaspati:2001nb,Copi:2008he,Chu:2011tx,Long:2013tha}. \nIt is not surprising then that substantial theoretical effort has been devoted to discover ways to\ngenerate primordial magnetic fields~(for recent reviews, see \\citealt{2011PhR...505....1K, 2012SSRv..166...37W, 2013A&ARv..21...62D}), understand their implications for the present\nstate of the universe~(e.g.,~\\citealt{aharonian, kim}),\nand to observe them using an array of\ntools~(e.g., see \\citealt{2012PhR...517..141Y} and\nreferences therein).\n\nUntil relatively recently, various cosmological observables yielded an upper bound on the\nmagnetic field strength at the nano Gauss level~(e.g. \\citealt{2013arXiv1303.5076P}), and blazar observations \nhave placed lower bounds at the $\\sim 10^{-16}~{\\rm G}$ level~\\citep{Neronov:1900zz,Tavecchio:2010mk,Dolag:2010ni,Essey:2011,Chen:2014}. An important\ndevelopment in the last few years is an appreciation of the importance of magnetic\nhelicity in the generation and evolution of cosmological magnetic fields. This has led\nto the exciting possibility to use the CP odd nature of the helicity to discover intergalactic\nmagnetic fields~\\citep{2004PhRvD..69f3006C,2005PhRvD..71j3006K,\nKahniashvili:2005yp,Tashiro:2013bxa,Tashiro:2014}. \nFurther, the helicity of the intergalactic magnetic field provides \nan unmistakable handle by which one can study detailed stochastic properties. \n\nWe have implemented these ideas to observe and measure \nthe strength of the intergalactic magnetic field and its correlation functions using diffuse\ngamma ray data from the Fermi-LAT satellite\\footnote{http:\/\/fermi.gsfc.nasa.gov}~\\citep{Tashiro:2013ita}. \nOur analysis and (updated) results are reviewed in Sec.~\\ref{sec:review} where we also test and confirm \npredictions made in~\\citet{Tashiro:2013ita}. \n\nThe successful predictions bolster confidence in the intergalactic magnetic field hypothesis.\nYet there are some other tests that are also essential to rule out other more mundane\nexplanations related to the observational techniques. Foremost among these is that\nFermi-LAT observations are not performed uniformly on the sky; instead different parts\nof the sky are sampled with (slightly) different time exposures. We now take the time\nexposure map into account in our Monte Carlo simulations which we use to calculate\nstatistical error bars. This results in larger error bars but the signal found in~\\citet{Tashiro:2013ita}\npersists with high significance. Another test is that Fermi-LAT provides \ntwo data sets for the diffuse gamma ray sky, namely the CLEAN and ULTRACLEAN\ndata sets, the former being recommended for analyses of the diffuse background but the latter \nis the most conservative.\nThe analysis in~\\citet{Tashiro:2013ita} used the CLEAN data set but,\nthroughout this paper, we use ULTRACLEAN, with essentially no change in results. A third\ntest is that a cosmological signal should be present over the whole sky, in particular\nit should be seen in both the northern and southern hemispheres. So we analyze the\nnorth and south data sets separately. The results show a much stronger signal in the\nnorth and a weaker signal in the south. At present we do not have a good explanation for the \ndifference in the strengths of the signal.\n\nIn Sec.~\\ref{sec:QRMH} we turn our attention to connecting the observed correlator of gamma\nrays described in Sec.~\\ref{sec:review} to the correlation function of magnetic fields. The analytical\nframework has already been set up in \\citet{Tashiro:2014}. We now use that framework to give a \n``proof of principles'' reconstruction of the intergalactic magnetic field helical correlator. \n\nWe conclude in Sec.~\\ref{conclusions}.\n\n\n\\section{Parity odd correlators: test of predictions}\n\\label{sec:review}\n\nConsider the location vectors, ${\\bm n}(E)$, of gamma rays of energy $E$ on the galactic \nsky. As motivated in~\\citet{Tashiro:2013ita}, we consider the triple-product correlator at energies \n$E_3 > E_2 > E_1$,\n\\begin{equation}\nQ \\left( R ; E_1,E_2,E_3 \\right) = \\frac{1}{N_1N_2N_3} \n\t \\sum_{i=1}^{N_1}\\sum_{j=1}^{N_2}\\sum_{k=1}^{N_3} \n W_R({\\bm n}_i (E_1) \\cdot {\\bm n}_k (E_3))\\, \n\t\t W_R({\\bm n}_j (E_2) \\cdot {\\bm n}_k (E_3))\\,\n\t\t {\\bm n}_i (E_1) \\times {\\bm n}_j (E_2) \\cdot {\\bm n}_k (E_3),\n\\label{Qdef}\n\\end{equation}\nwhere the indices $i$, $j$, and $k$ refer to different photons at energy $E_1$, $E_2$ and $E_3$ respectively. \nThe top-hat window function $W_R$ is given by\n\\begin{numcases}\n{W_R(\\cos\\alpha) =}\n1, \\nonumber & \\qquad for $\\alpha \\leq R$\n\\\\\n0, & \\qquad otherwise.\n\\end{numcases}\nThe statistic can also be written as\n\\begin{equation}\nQ(E_1,E_2,E_3,R) = \\frac{1}{N_3} \\sum_{k=1}^{N_3} \n {\\bm \\eta}_1\\times {\\bm \\eta}_2 \\cdot {\\bm n}_k(E_3)\n\\label{Qdef2}\n\\end{equation}\nwhere\n\\begin{equation}\n{\\bm \\eta}_a = \\frac{1}{N_a} \\sum_{i \\in D(n_k(E_3),R)} {\\bm n}_i (E_a), \\ \\ \\ a=1,2\n\\end{equation}\nand $D(n_k(E_3),R)$ is the ``disk'' or ``patch'' with center at the location of \n${\\bm n}_k(E_3)$ and with angular radius $R$. \n\nTo calculate $Q$ from data, we bin the data in the energy ranges (10,20),\n(20,30), (30,40), (40,50) and (50,60)~GeV. (The energies $E$ will refer to the lower\nend of the bin.) We also realize that the data will be \ncontaminated by gamma rays from the Milky Way and from other identified sources~\\citep{Ackermann:2014usa}. \nThese are avoided by only considering $E_3$ photons at very high galactic latitudes,\n$|b| > 80^\\circ$,\nand by excising a patch of angular radius $1.5^\\circ$ centered on sources identified in the First LAT High-Energy Catalog~\\citep{TheFermi-LAT:2013xza}.\n\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{52ultra_isotropic}\n \\end{center}\n\\caption{$Q(R)\\times 10^6$ versus $R$ for the ULTRACLEAN data set for weeks 9-328 for\n$R \\leq 30^\\circ$. The data points are shown with standard-error error bars. The Monte Carlo %\nerror bars (magenta) are generated under the isotropic assumption. Data points that deviate \nby more than 2$\\sigma$ are colored in red.\n}\n\\label{upto30degrees}\n\\end{figure}\n\nIn contrast to the analysis in~\\citet{Tashiro:2013ita} which used the Fermi-LAT CLEAN data set, in this \npaper we will use the more conservative ULTRACLEAN data set for Fermi-LAT observation\nweeks 9-328. With the latest release of the Fermi Science Tools, {\\tt v9r33p0}, \nwe follow the Fermi team recommendations to select good quality data\nwith a zenith angle cut of $100^\\circ$.\nHowever, the results are very similar with the use of either data set. In Fig.~\\ref{upto30degrees} \nwe show plots\nof $Q(R)$ for various energy combinations $(E_1,E_2)$; $E_3$ is always taken to be\n$50~{\\rm GeV}$. In these plots we also show the spreads obtained from Monte Carlo\nsimulations assuming that diffuse gamma ray background is isotropically distributed.\nIn Sec.~\\ref{sec:exposure} we will improve on the Monte Carlo simulations by using the Fermi-LAT \ntime exposure map.\n\n\nAnother feature in Fig.~\\ref{upto30degrees} is that we have extended our analysis to $R=30^\\circ$.\nThis is to test the prediction in~\\cite{Tashiro:2014} that $|Q(R)|$ should have a\npeak at\n\\begin{equation}\nR_{\\rm peak}(E_2) \\approx R_{\\rm peak, 0} \\left ( \\frac{E_2^{(0)}}{E_2} \\right )^{3\/2}\n\\label{Rpeak}\n\\end{equation}\nwhere $R_{\\rm peak, 0}$ is the location of the peak when $E_2 = E_2^{(0)}$.\nThe plot with $E_1=10~{\\rm GeV}$ and $E_2=40~{\\rm GeV}$ has a peak at $\\approx 14^\\circ$.\nThis implies that all plots with $E_2=40~{\\rm GeV}$ should also have peaks at\n$\\approx 14^\\circ$, a feature that is confirmed in Fig.~\\ref{upto30degrees}. Then \\eref{Rpeak} can\nbe used with $E_2=30~{\\rm GeV}$, $E_2^{(0)}=40~{\\rm GeV}$ to predict peaks at $\\approx 21^\\circ$ \nin the $(10,30)$ and $(20,30)$ plots. This feature is clearly seen in the $(10,30)$ plot in \nFig.~\\ref{upto30degrees}, but a clear peak is not present in the $(20,30)$ plot.\nThere should also be an inverted peak for $E_2=20~{\\rm GeV}$ at $R \\approx 40^\\circ$. \nHowever, as we will see in Sec.~\\ref{constructnuE},\nat such large angles, the Milky Way contribution becomes very strong and we do not see \nany indication of the cosmological signal. We also note that all the identified peaks in \nFig.~\\ref{upto30degrees} are inverted, as we would expect from magnetic fields with \nleft-handed helicity provided the spectrum is not too steep~\\citep{Tashiro:2014}.\n\nWe summarize the peak data in Table~\\ref{peaktable} as we will use it in later sections when\nwe model the magnetic field.\n\n\n\\begin{table*}\n \\begin{tabular}{|c||c|c|c|c|c|c| } \\hline\n $(E_1,E_2)$ & (10,20) & (10,30) & (10,40) & (20,30) & (20,40) & (30,40) \\\\ \\hline\n $(R_{\\rm peak})_{\\rm data}$ & ? & $19^\\circ$ & $13^\\circ$ & ? &\n\t\t $13^\\circ$ &$11^\\circ$ \\\\ \\hline\n$(Q_{\\rm peak})_{\\rm data}\\times 10^6$ &? & $-92$ &$-242$ &? & $-204$& $-177$ \\\\ \\hline\n \\end{tabular}\n \\caption{\n The peak locations and amplitudes. There is\n no well-identified peak in the (10,20) and (20,30) energy combinations.\n }\n \\label{peaktable}\n\\end{table*}\n\n\n\\section{Time-Exposure and Resampling analyses}\n\\label{sec:exposure}\n\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{timeexposurewithlats}\n\\end{center}\n\\caption{Fermi-LAT time exposure maps in the five energy bins. The $|b|=60^\\circ, 80^\\circ$ galactic\nlatitudes are shown as dashed white curves. \n }\n\\label{timeexposure}\n\\end{figure}\n\nFermi-LAT observations do not cover the sky uniformly. Using the latest release\nof the Fermi Science Tools, {\\tt v9r33p0}, we construct the time exposure map \nby first creating a livetime cube with {\\tt gtltcube} and then using\n\t{\\tt gtexpcube2} to obtain full sky exposure maps corresponding to the {\\em ultraclean} response function for each \nenergy bin.\nA plot of the time exposure over weeks 9-328 is shown in \nFig.~\\ref{timeexposure}.\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{52ultra_fermiexp}\n \\end{center}\n\\caption{The data overlaid on Monte Carlo generated error bars (magenta) by using the\ntime-exposure maps shown in Fig.~\\ref{timeexposure}.\n }\n\\label{Qwithexposure}\n\\end{figure}\n\n\nWith the time exposure maps shown in Fig.~\\ref{timeexposure} we run Monte Carlo simulations.\nThe error bars in Fig.~\\ref{Qwithexposure} are the statistical spread in the Monte Carlo $Q(R)$. In \nFig.~\\ref{Qwithexposure} we also overlay the data points on the Monte Carlo error bars. \n\nAn alternate way to account for the time exposure is to ``resample'' the data points. \nFor this we take the Fermi data and count the number of events in each energy bin. We then strip the data \nof all energy information. Then we randomly resample the observed number counts for each energy\nbin from this data set with replacement, choosing the 50~GeV photons first and ensuring that they are \nabove $80^\\circ$\nlatitude. $Q(R)$ is then calculated from this resampled data set and the whole procedure is repeated\nwith 10000 resamples. The result is shown in Fig.~\\ref{Qwithresampling} together with the observed\ndata points. As expected the Monte Carlo error bars are wider than those in Fig.~\\ref{upto30degrees} \nand are close to those of the time-exposure results in Fig.~\\ref{Qwithexposure}. A disadvantage\nin the resampling analysis compared to the time-exposure analysis is that resampling loses any \nenergy-dependent factors present in the observations. However, it is an independent check of\nthe signal.\n\nA cursory look at either Fig.~\\ref{Qwithexposure} or Fig.~\\ref{Qwithresampling} shows that the \nindividual points for $R=13^\\circ - 15^\\circ$ occurring in the $(10,40)~{\\rm GeV}$ energy panel are \nstill significant at more than $2\\sigma$; while 13 consecutive points, $R=7^\\circ-19^\\circ$, deviate at \nmore than $1\\sigma$. However the values of $Q(R)$ are correlated among various values of $R$ and \nalso among panels of different energies. In the absence of independent random variables, the relevant \nquantity to calculate is the probability of the overall patterns of deviations in all the different energy panels.\n\nWe have performed a simple evaluation of the statistical significance of the signal by counting\nMonte Carlo runs that deviate in the (10,40)~GeV panel by more than $+1\\sigma$ at 13 consecutive\n$R$ values. This gives a probability of $\\simeq 1\\%$. We could also include data in the other \nenergy panels but have resisted doing so because of the danger that there may be a ``look elsewhere'' \neffect. \n\n\nWhile the above test gives an estimate of how likely the data is to occur in the Monte-Carlo runs, \nthe criteria relies on the data itself and so is not completely satisfactory. Alternately, as\ndescribed in the following sections, our model predicts peaks and also that the peaks are roughly in \nthe same locations when $E_2$ is the same as is the case for panels (10,40)~GeV and (20,40)~GeV. \nAs another estimate of significance, we sample the Monte Carlo for panels (10,40)~GeV and (20,40)~GeV \nat values of $R=5^\\circ,10^\\circ,15^\\circ,20^\\circ$ and ask which of them have peaks at $10^\\circ$ or \n$15^\\circ$ in both panels. We define a peak by the maximum value being larger than the standard \ndeviation at the corresponding value of $R$. This procedure gives a probability of $\\simeq 3\\%$.\n\nThe correlation between $Q(R)$ for different values of $R$ and also across different panels makes\nit difficult to propose a clean test for significance. We have given the result for two such tests. \nHowever, we expect the issue to become clearer when more data is available and we also plan to \ndevelop Monte Carlo methods for alternate hypotheses which will allow us to perform Bayesian inference.\n\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{mc-resampled_galcut80nummc10000}\n \\end{center}\n\\caption{\nThe data overlaid on Monte Carlo generated error bars (magenta) by using the\nresampling method as described in the text.\n}\n\\label{Qwithresampling}\n\\end{figure}\n\n\\section{North-South analysis}\n\\label{sec:northsouth}\n\nIf the signal we see in Fig.~\\ref{upto30degrees} is cosmological, we expect it to exist both\nin the northern and the southern hemisphere. So we have split the $E_3=50~{\\rm GeV}$\nFermi-LAT data according to whether the galactic latitude is larger than $80^\\circ$\n(northern hemisphere) or less than $-80^\\circ$ (southern hemisphere). The resulting\nvalues of $Q(R)$ are shown in Fig.~\\ref{northsouthfig}, where we also plot the full sky results\nof Fig.~\\ref{upto30degrees} for comparison. \nFor clarity, we do not show the Monte Carlo error bars, which will be larger\nthan those for full sky shown in Fig.~\\ref{upto30degrees} by a factor $\\approx \\sqrt{2}$.\n\nThe peak values of $Q(R)$ obtained in the northern polar region have larger amplitude \nthan those obtained in the southern polar region. Yet the north-south plots have similarities, \nmost striking in the (10,30) and (30,40) panels. \nThere can be several reasons for a stronger signal in one polar region than the other.\nThe existence of the signal depends on the number of TeV blazars in the polar regions. \nThe Fermi-LAT time exposure is also slightly different in the north and south, yielding fewer \nphotons in almost all bins in the south (see Table~\\ref{photonnumber}).\n\n\n\\begin{table*}\n \\begin{tabular}{|l||c|c|c|c|c|} \\hline\n &10-20 GeV & 20-30 GeV & 30-40 GeV & 40-50 GeV & 50-60 GeV \\\\ \\hline\n\t North($>50^\\circ$) & 10329& 2598& 1187 & 596 & 350 \\\\\n\t South($>50^\\circ$) & 8058 & 2002& 869 & 386 & 267\\\\ \\hline\n\t Total ($>50^\\circ$) & 18387 & 4600 & 2056 & 982 & 617 \\\\ \\hline \\hline\n North($>80^\\circ$) & 798 & 208& 119 & 58 & 32 \\\\\n South($>80^\\circ$) & 500 & 124 & 37 & 28 & 23 \\\\ \\hline\n Total ($>80^\\circ$) & 1298 & 332 & 156 & 86 & 55 \\\\ \\hline\n \\end{tabular}\n \\caption{\nNumber of ULTRACLEAN photons for each energy bin collected in weeks 9-328 and\nthe North-South distribution for $|b| > 50^\\circ$ and $|b| > 80^\\circ$ without any source\nremoval.\n}\n \\label{photonnumber}\n\\end{table*}\n\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{North-South-Combined_80}\n \\end{center}\n\\caption{$Q(R)$ vs. $R$ for northern (red), southern (green), and north+south (light blue) data with the\npatch center absolute galactic latitudes $> 80^\\circ$. We have\nnot shown error bars for clarity but they are comparable to $\\sqrt{2}$ times those shown in \nFig.~\\ref{upto30degrees} with the isotropic assumption and Fig.~\\ref{Qwithexposure} with time \nexposure included.\n }\n\\label{northsouthfig}\n\\end{figure}\n\n\\section{From $Q(R)$ to $M_H$}\n\\label{sec:QRMH}\n\nIn this section, we will describe how to reconstruct the intergalactic magnetic helicity power spectrum,\n$M_H$, from the gamma ray correlators, $Q(R)$. As shown in~\\citet{Tashiro:2014}, the plot of $Q(R)$ is\nexpected to have a peak if there is an intergalactic helical magnetic field. The structure arises\nbecause $Q(R)$ must vanish at small $R$ for mathematical reasons (explained below), and it must also vanish\nat large $R$ because non-cascade photons, assumed to be isotropically distributed, dilute the signal \ncoming from the cascade photons\\footnote{In the realistic case, the Milky Way starts contributing\nat very large values of $R$ and can give a non-zero signal. This is the reason why \\citet{Tashiro:2013ita}\nhad restricted attention to $R < 20^\\circ$; in Fig.~\\ref{upto30degrees} we have gone up to $R=30^\\circ$ to\ntest the prediction of a peak at $\\approx 21^\\circ$ in the (10,30) and (20,30) panels.}. Therefore,\nin between, $Q(R)$ has to have a peak.\n\nIn the following analysis, we will adopt the model for $Q(R)$ described in~\\citet{Tashiro:2014}.\nThe first step is to define the bending angle for a gamma ray of observed energy $E_\\gamma$~\\citep{Tashiro:2013bxa}\n\\begin{equation}\n \\Theta (E_\\gamma) \\approx\n {e D_{\\rm TeV} D_e \\over E_e D_s} ~{v}_{L} {B}\n \\approx\n 7.3 \\times 10^{-5} ~ \\left( { B_0 \\over 10^{-16} ~{\\rm G}}\\right) \\left( {E_\\gamma\n \\over 100 ~{\\rm GeV}}\\right)^{-3\/2} \\left( {D_s\n \\over 1 ~{\\rm Gpc}}\\right)^{-1} \\left({1+z_s}\\right)^{-4},\n\\label{Theta}\n\\end{equation}\nwhere $e$ is the electron charge, $v_L \\sim 1$ is the speed, and $z_s$ the source\nredshift. Second we model the ratio of the number of cascade photons to the total number\nof photons in a patch of radius $R$\n\\begin{equation}\n\\frac{N_c}{N_t} = \n\\left ( 1 + \\frac{0.63~ \\nu(E) {\\cal A}(R, E)}{1- \\exp(-{\\cal A}(R,E))} \\right )^{-1},\n\\label{NcbyNt}\n\\end{equation}\nwhere ${\\cal A}(R,E) = A(R)\/A(\\Theta (E))$ and $A(R) = 2 \\pi (1-\\cos R)$ is the area of a patch\nof radius $R$. \\eref{NcbyNt} encapsulates all the information about the noise and signal photons\nin the function $\\nu(E)$ which can be viewed as the ratio of the number of non-cascade to\ncascade photons within a patch of radius $\\Theta(E)$. We will estimate this function below.\n\nThe model of~\\citet{Tashiro:2014} now gives\n\\begin{equation}\nQ(R) = \n\\left ( 1 + \\frac{0.63~ \\nu_1 {\\cal A}(R, E_1)}{1- \\exp(-{\\cal A}(R,E_1))} \\right )^{-1}\n\\left ( 1 + \\frac{0.63~ \\nu_2 {\\cal A}(R, E_2)}{1- \\exp(-{\\cal A}(R,E_2))} \\right )^{-1}\n\\frac{1}{1+\\nu_3} (1-e^{-R\/\\Theta_1})(1-e^{-R\/\\Theta_2}) Q_\\infty ,\n\\label{QRQc}\n\\end{equation}\nwhere we are using the short-hand notation: $\\nu_a = \\nu(E_a)$, $\\Theta_a = \\Theta (E_a)$\n($a=1,2,3$).\nThe last factor, $Q_\\infty$, is related to the magnetic field correlator, \n\\begin{align}\nQ_\\infty =\n- \\frac{10^{27}}{(1+z_s)^{12} { \\rm G^2}} \\left [\n \\frac{{q_{12}} |d_{12}| M_H (|d_{12}|)}{{\\cal E}_1^{3\/2} {\\cal E}_2^{3\/2}}\n+\\frac{{q_{23}} |d_{23}| M_H (|d_{23}|)}{{\\cal E}_2^{3\/2} {\\cal E}_3^{3\/2}}\n-\\frac{{q_{13}} |d_{13}| M_H (|d_{13}|)}{{\\cal E}_3^{3\/2} {\\cal E}_1^{3\/2}} \n\\right ] \n\\left ( \\frac{1~{\\rm Gpc}}{D_s} \\right )^2,\n\\label{Qinfty}\n\\end{align}\nwhere $q_{12}=\\pm 1$ refers to a ``charge ambiguity'' (see Sec.~\\ref{reconstructMH}), \n${\\cal E}_a = E_a \/(10~{\\rm GeV})$, and $d_{ab}$ is the distance at\nwhich $Q(R)$ probes the magnetic field\n\\begin{equation}\nd_{ab} \\approx \\left ( \\frac{\\delta_{\\rm TeV}}{E_b} \\right )^{1\/2} - \\left ( \\frac{\\delta_{\\rm TeV}}{E_a} \\right )^{1\/2}\n\\label{dab}\n\\end{equation} \nwhere $\\delta_{\\rm TeV} \\approx 5.6 \\times 10^5\/(1+z_s)^{4}~{\\rm GeV\\text{-}Mpc^2} \n\\approx 8.8 \\times 10^{40}\/(1+z_s)^{4}~{\\rm Gpc}$. \n\n\nGiven the observation energies $E_1$, $E_2$ and $E_3$, assuming a magnetic field\nstrength -- more correctly a value for the combination $B_0 (1~{\\rm Gpc}\/D_s) (1+z_s)^{-4}$\n-- we can find $\\Theta_1$ and $\\Theta_2$\nfrom \\eref{Theta}. Note that $\\nu_a$ and $Q_\\infty$ do not depend on $R$. So we can\n(in principle) find the extremum of $Q(R)$ by differentiating \\eref{QRQc}. This will tell\nus $R_{\\rm peak}(E_1,E_2,E_3)$ which we can insert into \\eref{QRQc} to get the\nratio $Q_{\\rm peak}(E_1,E_2,E_3)\/Q_\\infty$. If we use data to fix $Q_{\\rm peak}$, we can\ninfer $Q_\\infty$ for every energy combination, and that can be related to the magnetic\nhelicity power spectrum via \\eref{Qinfty}. Thus we can reconstruct $M_H$.\n\nA simplified partial analysis of this program yielded the interesting results that $R_{\\rm peak}$\nis approximately independent of $E_1$ ($E_3$ is fixed for the entire analysis). Hence the\npeak position of $Q(R)$ primarily depends on $E_2$ as given in \\eref{Rpeak}.\nFor magnetic power spectra that are not too steep, and if $\\nu (E)$ is also constant,\n$Q_{\\rm peak}$ also only depends on $E_2$~\\citep{Tashiro:2014}.\n\n\n\n\n\\subsection{Noise to signal ratio}\n\\label{constructnuE}\n\n\nThe function $\\nu (E)$ is a crucial ingredient in the reconstruction of $M_H$. It is defined as\nthe number of noise photons divided by the number of cascade photons in a patch whose\nangular radius is $\\Theta (E)$,\n\\begin{equation}\n\\nu (E) \\equiv \\frac{N_n(\\Theta(E))}{N_c(\\Theta(E))}.\n\\label{nuE}\n\\end{equation}\nThe noise photons are assumed to be isotropically distributed -- for the time being we ignore\nthe Milky Way contributions -- and so \n\\begin{equation}\nN_n \\propto A(R) = 2 \\pi (1-\\cos R)\n\\end{equation}\nwhile we expect the cascade photons to be clustered at small $R$. Hence if we plot the total\nnumber of photons in a patch of radius $R$, $N_t(R)$, we expect to see a peak at small $R$, \nand areal growth at large $R$. \n\nThis expectation is, however, confounded by two factors: first, at some large $R$, we expect \ngamma rays from the Milky Way to start out-numbering the cosmological photons, and second,\nwe have removed Fermi identified sources in our computation of $Q(R)$ to reduce the number \nof non-cascade photons. We will first discuss the Milky Way contamination and find that this\ncontribution is minimal for $R \\lesssim 20^\\circ{\\rm -}40^\\circ$ depending on the energy. The \nsource cuts remove both noise and possibly some signal (cascade photons). This fact has\nprevented us from deriving $\\nu_a$ from the source-cut data. Hence we will leave $\\nu_a$\nas free parameters with the additional mild assumption that $\\nu_a > 1$, as suggested by\nestimates of $\\nu_a$ with the data that includes sources.\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{NtvsR}\n \\end{center}\n \\caption{The average number of photons with energies $10, 20, 30, 40~{\\rm GeV}$ in \nhigh-latitude ($|b|>80^\\circ$) patches of size $R$ in the full data {\\it i.e.} without source cuts. \nUp to intermediate values of $R$, the data is fit well by the functions shown in the figures and\ndrawn in red. At larger $R$ the data deviates from the fit because those large patches extend to\nlower galactic latitudes where the Milky Way starts contributing to the photon numbers.\n }\n\\label{NtvsR}\n\\end{figure}\n\nAt some large $R$, we start sampling lower galactic latitudes, and so we expect gamma rays \nfrom the Milky Way to start out-numbering the cosmological photons. We do not want to extend \nour analysis to such large $R$. To determine these values of $R$, we plot the average number\nof photons in a patch of radius $R$ versus $R$, in the data without source cuts. The results\nare shown in Fig.~\\ref{NtvsR} and matches the clustering at low $R$, a flat\npart representing constant areal density, and then a rising part which is due to the Milky\nWay contamination. Thus we see that for $E=10,~20~{\\rm GeV}$, Milky Way contamination\nis minimal for $R \\lesssim 20^\\circ$, for $E=30~{\\rm GeV}$ we have $R \\lesssim 30^\\circ$,\nand for $E=40~{\\rm GeV}$ we have $R \\lesssim 40^\\circ$.\nSince we are not interested in gamma rays from the Milky Way, we only consider the curves up \nto the point where they start rising. Then, as in Fig.~\\ref{NtvsR}, we fit the plots to\n\\begin{equation}\n\\left [ \\frac{N_t(R)}{A(R)} \\right ]_{\\rm fit; ~all} = c_1(E) + \\frac{c_2(E)}{R^{3\/2}}.\n\\end{equation}\nwhere the subscript ``all'' means that sources are included in these fits.\nThe coefficient $c_1(E)$ is the areal density of noise photons (including sources), while $c_2(E)$\nis related to the number of cascade photons. Thus we get\n\\begin{equation}\n\\nu_{\\rm all} (E) = \\frac{c_1(E)\\Theta(E)^{3\/2}}{c_2(E)}\n\\end{equation}\nNote that $\\nu_{\\rm all}(E)$ depends on the magnetic field through $\\Theta(E)$ as given in\n\\eref{Theta}.\n\nThe scheme described above does not\nwork for $E=50~{\\rm GeV}$ photons because our patches are centered on these photons\nand there is precisely one $50~{\\rm GeV}$ photon per patch. Then to estimate $\\nu_{\\rm all}(50)$, we\nfit a power law to the values of $\\nu_{\\rm all} (E)$ determined at the lower energies with the\nresult $\\nu_{\\rm all} (E) \\propto E^{-2.6}$,\nand then extrapolate to $E=50~{\\rm GeV}$. The resulting numbers for \n$\\nu_{\\rm all} (E)$ for $B = 5.5 \\times 10^{-14}~{\\rm G}$\nare shown in Table~\\ref{nuEtable}. The values for other $B$ are easily determined by\nnoting that $\\nu_{\\rm all} (E) \\propto \\Theta^{3\/2} \\propto B^{3\/2}$ and we can also give an\nexplicit fitting function\n\\begin{equation}\n\\nu_{\\rm fit; all} (E) = 166 \\left ( \\frac{10~{\\rm GeV}}{E} \\right )^{2.5}\n \\left ( \\frac{B}{5.5 \\times 10^{-14}~{\\rm G}} \\right )^{3\/2}\n \\left [ \\left (\\frac{D_s}{1~\\rm Gpc}\\right ) (1+z_s)^4 \\right ]^{-3\/2}.\n\\label{eq:nuE_50Gev}\n\\end{equation}\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=150mm]{NtnosourcevsR}\n \\end{center}\n\\caption{\n\tSame as in Fig.~\\ref{NtvsR}, but now with source cuts.\n}\n\\label{NtnosourcevsR}\n\\end{figure}\n\nNext we consider the effect of source cuts and plot the average number of photons\nin a patch versus patch radius in Fig.~\\ref{NtnosourcevsR}. Note that the area of a patch\nof radius $R$ is no longer given by $A(R)=2\\pi (1-\\cos R)$ since the patches have holes\nin them. For Fig.~\\ref{NtnosourcevsR}, we have used the correct average area of a\npatch of radius $R$ that we evaluated by Monte Carlo methods. However, the plots in\nFig.~\\ref{NtnosourcevsR} do not have a clear excess at small $R$ that we can identify\nwith cascade photons, nor a clear flat region that we can identify with a constant areal\ndensity of non-cascade photons. For these reasons, we are unable to extract values\nof $\\nu_a$ with confidence and will leave these as free parameters for the most part.\nBelow, when we do need to insert numerical values of $\\nu_a$, we will take \n$\\nu(E) = \\nu_{\\rm all}(E)$ as given in Table~\\ref{nuEtable}. We hope that the values\nof $\\nu_a$ will be determined more satisfactorily in the future.\n\n\n\\begin{table*}\n \\begin{tabular}{|c||c|c|c|c|c|c| } \\hline\n Energy bin & 10-20 & 20-30 & 30-40 & 40-50 &50-60 \\\\ \\hline\n$\\Theta (E)$ & $73^\\circ$ & $26^\\circ$ &$14^\\circ$ &$9^\\circ$ &\n\t\t $7^\\circ$ \\\\ \\hline\n$\\nu_{\\rm all} (E)$ & 156 & 30 & 8 &4 & 2 \\\\ \\hline\n\\end{tabular}\n \\caption{\n Values of the bending angles from \\eref{Theta} for $B = 5.5 \\times 10^{-14}~{\\rm G}$ and \n $\\nu_{\\rm all}(E)$ deduced from the fits in Fig.~\\ref{NtvsR} that counts ``all'' photons,\n including those from sources. Note that $\\nu_{\\rm all}(50)$ is \nestimated by using a power law fit to the data for $\\nu_{\\rm all}(E)$ at other energies.\n }\n \\label{nuEtable}\n\\end{table*}\n\n\n\n\\subsection{$|{\\bf B}|$ from peak position}\n\\label{Bpeakposition}\n\nTo obtain the location of the peaks of $Q(R)$, note that all the $R$ dependent factors in \\eref{QRQc} can be\nseparated out as\n\\begin{equation}\nq(R) \\equiv \\frac{(1+\\nu_3) Q(R)}{Q_\\infty} =\n\\left ( 1 + \\frac{0.63~ \\nu_1 {\\cal A}(R, E_1)}{1- \\exp(-{\\cal A}(R,E_1))} \\right )^{-1}\n\\left ( 1 + \\frac{0.63~ \\nu_2 {\\cal A}(R, E_2)}{1- \\exp(-{\\cal A}(R,E_2))} \\right )^{-1}\n(1-e^{-R\/\\Theta_1})(1-e^{-R\/\\Theta_2}).\n\\end{equation}\nNext we define $x = R\/\\Theta_1$, $\\beta = \\Theta_1 \/\\Theta_2$. We also note that\nwe are only interested in relatively small $R$ and so $A(R) \\approx \\pi R^2$. Further,\nwith the assumption $\\nu_i \\gtrsim 1$, we can simplify the first two factors around\n${\\cal A} \\approx 1$ and then\n\\begin{equation}\nq(x) \\approx \n\\left ( \\frac{0.63~ \\nu_1 x^2}{1- \\exp(-x^2)} \\right )^{-1}\n\\left ( \\frac{0.63~ \\nu_2 \\beta^2 x^2}{1- \\exp(-\\beta^2 x^2)} \\right )^{-1}\n(1-e^{-x})(1-e^{-\\beta x}).\n\\end{equation}\nThe location of the extremum of this function does not depend on the $\\nu_a$ since\nthose are just multiplicative factors. So $q(x)$ will have a peak at $x = x_{\\rm peak}(\\beta )$.\nHowever, from \\eref{Theta}, $\\beta = \\Theta_1\/\\Theta_2$ does not depend on $B$.\nSo the position of the peak in $x$ is independent of the magnetic field, and the peak position\nin $R$ depends linearly on $B$ {\\it i.e.} $R_{\\rm peak} \\propto B$. \n\nFig.~\\ref{RpeakvsB} shows the peak position in the model $Q(R)$ as a function of $B$ with the \nchoice $\\nu_a =\\nu_{\\rm all}(E_a)$. Also, the observed locations of the peaks in Table~\\ref{peaktable} \nare shown in Fig.~\\ref{RpeakvsB}. We find that all four peak positions line up and can be consistently \nexplained with\n\\begin{equation}\nB \\approx 5.5\\times 10^{-14} \\left [\\left (\\frac{D_s}{1~\\rm Gpc}\\right ) (1+z_s)^4 \\right ] ~{\\rm G} .\n\\end{equation}\nEven though we have adopted $\\nu_a =\\nu_{\\rm all}(E_a)$ for drawing purposes in Fig.~\\ref{RpeakvsB}, \nas argued above, the estimate of $B$ is independent of this choice provided $\\nu_a \\gtrsim 1$.\n\n\\begin{figure}\n \\begin{center}\n \\includegraphics[width=80mm]{RpeakvsB}\n \\end{center}\n\\caption{\nPeak position versus $B$. The observed values, with an error of $\\pm 1^\\circ$,\nare shown as horizontal bands. The observations are consistent for\n$B \\approx 5.5\\times 10^{-14}({D_s}\/{1~\\rm Gpc} ) (1+z_s)^4 ~{\\rm G}$. \nThe plots for $(E_1,E_2) = (10,20), (20,30)~{\\rm GeV}$\n(top line and blue line)\nare drawn though the data does not show any well-defined peaks for these energy\ncombinations.}\n\\label{RpeakvsB}\n\\end{figure}\n\n\n\\subsection{Reconstruction of $M_H$}\n\\label{reconstructMH}\n\nWe now take the values of $\\Theta (E)$ from Table~\\ref{nuEtable} and the \npeak locations, $(R_{\\rm peak})_{\\rm data}$, and amplitudes, $(Q_{\\rm peak})_{\\rm data}$, \nshown in Table~\\ref{peaktable}, insert them\nin \\eref{QRQc} to find $Q_\\infty$ for the energy combinations in which a definite peak is\nobserved. In addition we assume that $\\nu_a \\gtrsim 1$. Then the values of $Q_\\infty$ \nare shown in Table~\\ref{Qinftytable}. \nAdditionally, we can find the distances $d_{ab}$ for each energy combination\nfrom \\eref{dab} with the numerical values shown in Table~\\ref{dabtable}.\n\n\\begin{table*}\n \\begin{tabular}{|c||c|c|c|c|c|c| } \\hline\n $(E_1,E_2,E_3=50)$ [GeV] & (10,20) & (10,30) & (10,40) & (20,30) & (20,40) & (30,40) \\\\ \\hline\n$Q_\\infty$ & ? & -2.2 & -4.1 & ? & -0.3 & -0.1 \\\\ \\hline\n\\end{tabular}\n \\caption{\n $Q_\\infty$ for different energy combinations with the assumption $\\nu(E) = \\nu_{\\rm all}(E)$,\nrounded to one decimal place. \n}\n \\label{Qinftytable}\n\\end{table*}\n\n\\begin{table*}\n \\begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c| } \\hline\n $(E_1,E_2)$ [GeV]& (10,20) & (10,30) & (10,40) & (10,50) & (20,30) & (20,40) & (20,50)& (30,40)& (30,50)&(40,50) \\\\ \\hline\n$d_{ab}$ [Mpc] & 69 & 100 & 118 & 131 & 31 & 49 & 61 & 18 & 31 &12 \\\\ \\hline\n\\end{tabular}\n \\caption{$d_{ab}$ for different energy combinations.\n }\n \\label{dabtable}\n\\end{table*}\n\nThe magnetic helicity spectrum is now given by \\eref{Qinfty} which we re-write as\n\\begin{align}\n \\frac{m_{ab}}{{\\cal E}_a^{3\/2} {\\cal E}_b^{3\/2}}\n+\\frac{m_{bc}}{{\\cal E}_b^{3\/2} {\\cal E}_c^{3\/2}}\n-\\frac{m_{ac}}{{\\cal E}_c^{3\/2} {\\cal E}_a^{3\/2}} \n= - Q_\\infty (E_a,E_b,E_c)\n\\label{mabeqns}\n\\end{align}\nwhere ${\\cal E}_a = E_a\/(10~{\\rm GeV})$, $E_a < E_b < E_c $ and\n\\begin{equation}\nm_{ab} \\equiv \\frac{ q_{ab} |d_{ab}| M_H( |d_{ab}|) }\n {\\left [ 3\\times 10^{- 14} (1+z_s)^6 \\frac{D_s}{1~{\\rm Gpc}} \\right ]^2 {\\rm G}^2 }\n \\label{mabdef}\n\\end{equation}\nIn our case, we have observed four peaks, and so we have four such equations,\n\\begin{eqnarray}\n\\hskip 6 cm\n \\frac{m_{13}}{3^{3\/2}}\n +\\frac{m_{35}}{15^{3\/2}}\n-\\frac{m_{15}}{5^{3\/2}} \n&=& 2.2\\\\\n\\hskip 6 cm\n \\frac{m_{14}}{4^{3\/2}}\n+\\frac{m_{45}}{20^{3\/2}}\n-\\frac{m_{15}}{5^{3\/2}} \n&=& 4.1 \\\\\n\\hskip 6 cm\n \\frac{m_{24}}{8^{3\/2}}\n+\\frac{m_{45}}{20^{3\/2}}\n-\\frac{m_{25}}{10^{3\/2}} \n&=& 0.3\\\\\n\\hskip 6.2 cm\n \\frac{m_{34}}{12^{3\/2}}\n+\\frac{m_{45}}{20^{3\/2}}\n-\\frac{m_{35}}{15^{3\/2}} \n&=& 0.1\n\\label{simultaneous}\n\\end{eqnarray}\nThese 4 simultaneous linear equations involve 8 unknowns: \n$m_{13}, ~m_{14}, ~m_{15}, ~m_{24}, ~m_{25}, ~m_{34}, ~m_{35}, ~m_{45}$. \nThus the system does not have a unique solution and additional physical input is required.\nFor the present analysis, we will consider three cases: ultra-blue spectrum in which the \nspectrum vanishes at large distances, ultra-red spectrum in which the spectrum\nvanishes at small distances, and a power law spectrum.\n\nIn the case of the ultra-red spectrum, we assume that the spectrum on the smallest length scales\nvanish: $m_{24}=0=m_{34}=m_{35}=m_{45}$ and solve for $m_{13}, ~m_{14}, ~m_{15}, ~m_{25}$.\nThis does not work, however, because the assumption is inconsistent with \\eref{simultaneous},\nas the left-hand side vanishes while the right-hand side is non-vanishing. Thus, at least with\nthese simple assumptions, the data does not fit an ultra-red spectrum.\n\nIn the ultra-blue spectrum case, we set\n$m_{ab} = 0$ for the larger values of $d_{ab}$ in Table~\\ref{dabtable}. Then \n$m_{13}=0=m_{14}=m_{15}=m_{25}$ and the only non-zero unknowns to solve for are\n$m_{24}, ~m_{34}, ~m_{35}, ~m_{45}$. The solution is\n\\begin{equation}\n(d, m)_{45} = (12,367), \\ \n(d, m)_{34} = (18,-75), \\ \n(d, m)_{35} = (31,128), \\ \n(d, m)_{24} = (49,-93), \n \\ \\ \\ ({\\rm ultra-blue\\ assumption})\n \\label{bluesoln}\n\\end{equation}\nwhere we also show the distance scale of the correlation (in Mpc).\n\nNext we would like to go from $m_{ab}$ to $|d_{ab}|M_H(|d_{ab}|)$ by using\n\\eref{mabdef}. Here we need to resolve the discrete ``charge ambiguity'' factors $q_{ab}$.\nTo understand how these factors arise, recall that pair production by TeV gamma rays\nresults in electrons and positrons. These carry opposite electric charges and are bent\nin opposite ways in a magnetic field. The cascade gamma rays we eventually observe\ncould have arisen due to inverse Compton scattering of an electron or a positron. This\nambiguity is encapsulated in $q_{ab} = q_a q_b$ where $q_a = \\pm 1$ represents the sign of \nthe charge of the particle that resulted in the observed gamma ray of energy $E_a$.\n\nTo determine $q_{ab}$ we work with the assumption that the magnetic helicity power\nspectrum, $M_H(d)$, has the same sign over the distance scales of interest. Then\nthere are two cases to consider: $M_H > 0$ or $M_H < 0$. If we assume $M_H > 0$,\nthen with the signs of $m_{ab}$ in \\eref{bluesoln},\nwe get $q_4 q_5 =+1$, $q_3 q_4 =-1$, $q_3 q_5 =+1$ and $q_2 q_4 =-1$. \nMultiplying the first three relations gives $q_3^2 q_4^2 q_5^2 =-1$, which has no real\nsolutions. Hence there is no consistent solution with $M_H > 0$. On the other hand, if\nwe assume $M_H < 0$, we need $q_4 q_5 = -1$, $q_3 q_4 =+1$, $q_3 q_5 =-1$ and\n$q_2 q_4 =+1$. Then $q_2 = q_3 = q_4 = - q_5$ is a solution (with either choice of \n$q_2=\\pm 1$). With this solution, we find\n\\begin{equation}\n(d_{ab}, |d_{ab}| M_H(|d_{ab}|) =\n(12,-3.7), \\ \n(18,-0.7), \\ \n (31,-1.3), \\ \n(49,-0.9), \n \\ \\ \\ ({\\rm ultra-blue\\ assumption})\n\\end{equation}\nwhere $d_{ab}$ is in Mpc and the correlator is in units of \n$[3\\times 10^{-13} (1+z_s)^6 (D_s\/1~{\\rm Gpc}) ~{\\rm G}]^2$. \nHowever, this estimate of the \nhelical power spectrum with the ultra-blue assumption is in tension with the estimate of the \nmagnetic field strength\nbased on the peak location, $\\sim 5\\times 10^{-14}~{\\rm G}$, since the magnetic helicity\ndensity is bounded by the energy density of the magnetic field via the so-called\n``realizability condition'' \\citep{Moffat:1978}. \n\n\nAnother approach is to assume that the helicity power spectrum has a power law dependence on\ndistance,\n\\begin{equation}\nr M_H(r) = A \\left ( \\frac{r}{\\rm Mpc} \\right )^p \\left [ 3\\times 10^{- 14} (1+z_s)^6 \\frac{D_s}{1~{\\rm Gpc}} \\right ]^2 {\\rm G}^2 \n\\end{equation}\nand then determine the best fit values of $A$ and $p$ by minimizing the error function\n\\begin{equation}\nE(A,p) = \\sum_{i=1}^4 \\left ( \\frac{\\rm lhs}{\\rm rhs} -1 \\right)_i^2\n\\end{equation}\nwhere $i=1,2,3,4$ labels the four simultaneous equations in \\eref{simultaneous},\n``lhs'' and ``rhs'' refer to the left-hand side and right-hand side of those equations, and we\nset $q_{ab}=+1$. Note that the construction of $E(A,p)$ gives equal weight to the four equations;\nfor example, if we define the error via $\\sum ({\\rm lhs}-{\\rm rhs})_i^2$, this would give greater\nweight to equations with larger ${\\rm rhs}$. Then we obtain the best fit values\n\\begin{equation}\nA = 2.08, \\ \\ \\ p = +0.56\n\\label{MHbestfit}\n\\end{equation}\nwhich suggests a mildly red spectrum.\n\n\nWe would like to caution the reader that the results of this section depend on the assumption \n$\\nu(E) = \\nu_{\\rm all}(E)$ as given in Table~\\ref{nuEtable} which is probably not accurate.\nThe intent of the above analysis is to show that a reconstruction of the helical power spectrum\nmay be possible once a definitive model for $Q(R)$ is established.\n\n\n\\section{Conclusions}\n\\label{conclusions}\n\n\nWe have re-examined the finding in \\cite{Tashiro:2013ita} that the parity-odd correlator, $Q(R)$, of \nFermi-LAT observed gamma rays does not vanish. We have used the most recent data (weeks 9-328)\nand find that the signal originally found in data up to September 2013 persists and is, in fact, a\nlittle stronger (see~\\url{https:\/\/sites.physics.wustl.edu\/magneticfields\/wiki\/index.php\/Search_for_CP_violation_in_the_gamma-ray_sky} for a time sequence of results).\n We have also successfully tested the prediction \nof a peak in the (10,30) data around $R \\approx 21^\\circ$ \\citep{Tashiro:2014} and the locations\nof the peaks in the other panels as seen in Fig.~\\ref{upto30degrees}. Building on the model of\n\\cite{Tashiro:2014}, we find that all the peak locations in Fig.~\\ref{upto30degrees} can be explained\nby a single value of the magnetic field strength: $B \\sim 5.5\\times 10^{-14}~{\\rm G}$ \n(see Fig.~\\ref{RpeakvsB}). The plots of $Q(R)$ in the northern and southern hemispheres\nseparately show similar signals in some energy panels but not in others\n(Fig.~\\ref{northsouthfig}), for which we do not have an explanation.\nThe peak amplitudes have then been used to reconstruct the\nmagnetic helicity spectrum under the assumptions of either an ultra-red spectrum or an \nultra-blue spectrum. The assumption of an ultra-red spectrum does not \nyield a solution; the \nassumption of an ultra-blue spectrum yields the helicity power spectrum at four distance scales,\nhowever the field amplitude is in tension with the realizability condition. \nThe sign of the helicity depends on the\nsign of the charged particles that are responsible for the inverse Compton scattering of the\nCMB photons. We find that this sign ambiguity has a unique resolution if we assume that the\nspectrum is either everywhere positive or everywhere negative {\\it i.e.} $M_H > 0$ or\n$M_H < 0$ at all distance scales, in which case the helicity is \nnegative (left-handed). We have also worked with the assumption\nthat the helicity spectrum is a power law to find the best fit amplitude and exponent as given in\n\\eref{MHbestfit}. The reconstruction of the power spectrum should be considered a ``proof of principle'' \nand not a definitive claim since it assumes a noise to signal ratio, $\\nu(E)$, and also certain other\nassumptions, {\\it e.g.} that the helical spectrum does not change sign over the length scales of\ninterest.\n\nWe have made several improvements on the\nanalysis to check the robustness of the results. The change from the Fermi-LAT CLEAN to\nULTRACLEAN data set makes no difference to the signal; the error bars obtained from Monte Carlo\nsimulations that include the Fermi-LAT time exposure are larger but the signal is still statistically\nsignificant at the $\\lesssim 1\\%$ level. \n\n\nAnother outcome of our analysis in Sec.~\\ref{constructnuE} is that the Milky Way starts \ncontributing to the gamma ray data set at $R \\gtrsim 20^\\circ$ for the 10~GeV bin and at yet \nlarger $R$ for higher energies (Fig.~\\ref{NtvsR}). Even though our non-trivial signals occur\nat $R \\lesssim 20^\\circ$, this raises the question if the Milky Way is somehow responsible for the \nsignal we are detecting. This seems unlikely to us for several reasons:\n(i) we observe a signal even in the (30,40)~GeV data set where contamination is seen to be minimal, \n(ii) the signal has a peak structure whereas Milky Way contamination would presumably lead to a\nmonotonically increasing signal at large $R$, and \n(iii) that the whole pattern of peak locations fits the helical magnetic field hypothesis very well. \nTo further confirm the signal, as more data is accumulated, we could restrict attention to only the \nhigher energies but reduce the bin size, {\\it e.g.} in 5~GeV bin widths instead of the current \n10~GeV bins. The higher energies would limit the Milky Way contamination and the several (smaller) \nbins would still give us the magnetic helicity spectrum over a range of distance scales.\n\n\n\\section*{acknowledgements}\nWe are grateful to a large number of colleagues who have made suggestions for further tests\nof our results in~\\citet{Tashiro:2013ita}. We would especially like to thank \nJim Buckley, Dieter Horns, \nOwen Littlejohns, Andrew Long, Guenter Sigl, David Spergel, and Neal Weiner for their remarks.\nThis work was supported by MEXT's Program for Leading Graduate Schools ``PhD professional: \nGateway to Success in Frontier Asia,'' the Japan Society for Promotion of Science (JSPS) Grant-in-Aid \nfor Scientific Research (No.~25287057) and the DOE at ASU and at WU.\n\n\n\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}