Unitary Closed Timelike Curves can Solve all of NP

Extracted source text · arXiv 2410.04630

\newif\ifnotes
\newif\ifcr
\notestrue
\crfalse

%%% LLNCS format for IACR submissions
\newif\ifllncs
 \llncsfalse
 %\llncstrue
%%%%

\ifnotes
\newcommand{\omri}[1]{$\ll$\textsf{\color{blue} Omri: { #1}}$\gg$}


\else
\newcommand{\omri}[1]{}
\fi


\ifllncs
\documentclass[11pt]{llncs}
% \let\proof\relax
% \let\endproof\relax
\else
\documentclass[a4paper,11pt]{article}
\usepackage{amsthm}
\usepackage{fullpage}
\fi
\usepackage{footmisc} % Needs to be before the "hyperref" usage, as it sometimes can cause problems with footnotes.
\usepackage[hypertexnames=false,colorlinks=true,citecolor=Maroon]{hyperref}
\usepackage{newtxtext}
\usepackage{amsmath,amssymb,enumerate,algorithm,algorithmic,latexsym}
\usepackage{tikz}
\usetikzlibrary{fpu}
\usepackage{breakcites}
\usepackage{float}
\newfloat{algorithm}{H}{lop}
\usepackage{color}
\usepackage{colortbl}
\definecolor{Maroon}{cmyk}{0, 0.87, 0.68, 0.32}
\usepackage{url}
\usepackage{graphicx}
\usepackage{xspace}
\usepackage{subfigure}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{enumitem}
\usepackage{soul}
\usepackage[normalem]{ulem}
\usepackage{url}
\usepackage{graphicx}
\usepackage{bookmark}
\numberwithin{algorithm}{section}
\usepackage{mathtools}
\usepackage{dsfont}
\usepackage{cleveref}
%
%\usepackage{polyglossia}
%\defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase}
%\setdefaultlanguage{english}
%\setotherlanguage{hebrew}
%\newfontfamily\hebrewfont[Script=Hebrew]{Times New Roman}


\renewcommand{\paragraph}[1]{\vspace{1.5mm}\noindent \textbf{#1}}

% Omri's added macros
\newcommand{\Nat}{\mathbb{N}}
\newcommand{\bbZ}{\mathbb{Z}}
\newcommand{\bbC}{\mathbb{C}}
\newcommand{\bbR}{\mathbb{R}}
\newcommand{\bbE}{\mathbb{E}}
\newcommand{\lang}{\mathcal{L}}
\newcommand{\Var}{\text{Var}}
\newcommand{\poly}{\mathsf{poly}}
\newcommand{\WI}{\textbf{WI}}
\newcommand{\OS}{\textbf{OS}}
\newcommand{\OI}{\textbf{OI}}
\newcommand{\OOI}{\mathcal{O}_{\OI}}
\newcommand{\BQP}{\textbf{BQP}}
\newcommand{\NP}{\textbf{NP}}
\newcommand{\QCMA}{\textbf{QCMA}}
\newcommand{\BQPICS}{\textbf{BQP}^{\text{ICS}}}
\newcommand{\BQPOI}{\textbf{BQP}^{\text{OI}}}
\newcommand{\GCVP}{\mathsf{GapCVP}}
\newcommand{\LWE}{\mathsf{LWE}}
\newcommand{\GSVP}{\mathsf{GapSVP}}
\newcommand{\SAT}{\mathsf{SAT}}
\newcommand{\GI}{\mathsf{GI}}
\newcommand{\SZK}{\textbf{SZK}}
\newcommand{\SISD}{\mathsf{SISD}}
\newcommand{\SD}{\mathsf{SD}}
\newcommand{\Basis}{\mathbf{B}}
\newcommand{\Lattice}{\mathcal{L}}
\newcommand{\Rel}{\mathcal{R}}
\newcommand{\sVector}{\mathbf{s}}
\newcommand{\aVector}{\mathbf{a}}
\newcommand{\bVector}{\mathbf{b}}
\newcommand{\tVector}{\mathbf{t}}
\newcommand{\vVector}{\mathbf{v}}
\newcommand{\pVector}{\mathbf{p}}
\newcommand{\eVector}{\mathbf{e}}
\newcommand{\uVector}{\mathbf{u}}
\newcommand{\YES}{\prod_{\text{YES}}}
\newcommand{\NO}{\prod_{\text{NO}}}
\newcommand{\dist}{\text{dist}}
\newcommand{\QFT}{\mathsf{QFT}}
\newcommand{\CTC}{\text{CTC}}
\newcommand{\NSD}{\text{NSD}}
\newcommand{\CJ}{\mathbf{CJ}}
\newcommand{\Lin}{\mathcal{L}}
\newcommand{\Hilb}{\mathcal{H}}
\newcommand{\channel}{\mathcal{C}}
\newcommand{\states}{\mathcal{S}}
\newcommand{\pmo}{\mathbf{PMO}}
\newcommand{\pmc}{\mathbf{PMC}}
\newcommand{\pmg}{\mathbf{PMG}}
\newcommand{\BQPlctc}{\BQP_{\ell\CTC}} % linear closed timelike curves
\newcommand{\BQPuctc}{\BQP_{u\CTC}} % Unitary closed timelike curves
\newcommand{\FBQPctc}{\textbf{FBQP}_{\ell\CTC}} % Function BQP_lctc
\newcommand{\PBQPctc}{\textbf{PBQP}_{\ell\CTC}} % Promise BQP_lctc
\newcommand{\searchBQP}{\textbf{SearchBQP}} % search BQP
\newcommand{\searchBQPuctc}{\textbf{SearchBQP}_{u\CTC}} % search BQP
\newcommand{\GenCTC}{\mathsf{Gen}_{\mathcal{CTC}}} % CTC generator
\newcommand{\USAT}{\mathsf{USAT}}
\newcommand{\GenLCTC}{\mathsf{Gen}_{\ell\mathcal{CTC}}} % Linear CTC generator
\newcommand{\GenUCTC}{\mathsf{Gen}_{u\mathcal{CTC}}} % Unitary CTC generator





% Dirac
\newcommand{\ket}[1]{|{#1}\rangle}
\newcommand{\bra}[1]{\langle{#1}|}
\newcommand{\braket}[2]{\langle{#1}|{#2}\rangle}
\newcommand{\ketbra}[2]{\ket{{#1}}\bra{{#2}}}
\newcommand{\Dket}[1]{| {#1} \rangle\!\rangle}
\newcommand{\Dbra}[1]{\langle\!\langle {#1} |}

% Textual abbreviations (not for mathematical expressions)
\newcommand{\textabbrevstyle}[1]{\mbox{#1}}
\newcommand{\textabbrevstylebol}[1]{\mbox{\textbf{#1}}}
\newcommand{\newtextabbrev}[1]{\expandafter\newcommand\csname #1\endcsname{\textabbrevstyle{#1}\xspace}}
\newcommand{\newtextabbrevbol}[1]{\expandafter\newcommand\csname #1\endcsname{\textabbrevstylebol{#1}\xspace}}
\newcommand{\renewtextabbrevbol}[1]{\expandafter\renewcommand\csname
#1\endcsname{\textabbrevstylebol{#1}\xspace}}

\newtextabbrevbol{EXP}
\newtextabbrevbol{Dtime}
\newtextabbrev{PRG}
\newtextabbrev{PRF}
\newtextabbrev{OWF}
\newtextabbrev{DPT}
\newtextabbrev{PPT}
\newtextabbrev{QPT}
\newtextabbrev{EOWF}
\newtextabbrev{GEOWF}
\newtextabbrev{ZAP}
\newtextabbrevbol{Ntime}
\newtextabbrevbol{coAM}
\newtextabbrevbol{MIP}
\newtextabbrevbol{NEXP}
\newtextabbrevbol{BPP}
\newtextabbrevbol{coNP}
\newtextabbrevbol{coMA}
\newtextabbrevbol{TFNP}
\newtextabbrev{NIWI}
\newtextabbrevbol{AM}
\newtextabbrev{SNARG}
\newtextabbrev{SNARK}
\newtextabbrev{coRP}
\newtextabbrev{NIUA}
\newtextabbrev{UA}
\newtextabbrev{ZK}
\newtextabbrev{WZK}
\newtextabbrev{WH}
\newtextabbrev{AI}
\newtextabbrev{ECRH}
\newtextabbrev{PIR}
\newtextabbrev{WIPOK}
\newtextabbrev{CDS}
\newtextabbrev{POK}
\newtextabbrev{FE}
\newtextabbrev{IO}
\newtextabbrev{XIO}
\newtextabbrev{SXIO}
\newtextabbrev{SKFE}
\newtextabbrev{PKFE}
\newtextabbrev{PPRF}
\newtextabbrev{QLWE}
\newtextabbrev{PKE}
\renewcommand{\P}{\textabbrevstylebol{P}\xspace}
\newcommand{\Plogpoly}{\P^{\log}/\textabbrevstylebol{poly}\xspace}
\newcommand{\Ppoly}{\textabbrevstylebol{P}/\textabbrevstylebol{poly}\xspace}
\newcommand{\NPpoly}{\textabbrevstylebol{NP}/\textabbrevstylebol{poly}\xspace}
\newcommand{\NC}{\textabbrevstylebol{NC}}
\newcommand{\QMA}{\textabbrevstylebol{QMA}}


\ifllncs
\else
\newtheorem{definition}{Definition}[section]
\newtheorem{fact}{Fact}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{claim}{Claim}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{hypothesis}{Hypothesis}[section]
\newtheorem{observation}{Observation}[section]
\theoremstyle{remark}
\newtheorem{construction}{Construction}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{example}{Example}[section]
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\secref}[1]{Section~\protect\ref{#1}}
\newcommand{\appref}[1]{Appendix~\protect\ref{#1}}
\newcommand{\defref}[1]{Definition~\protect\ref{#1}}
\newcommand{\assref}[1]{Assumption~\protect\ref{#1}}
\newcommand{\conref}[1]{Construction~\protect\ref{#1}}
\newcommand{\figref}[1]{Figure~\protect\ref{#1}}
\newcommand{\tblref}[1]{Table~\protect\ref{#1}}
\newcommand{\thmref}[1]{Theorem~\protect\ref{#1}}
\newcommand{\prpref}[1]{Proposition~\protect\ref{#1}}
\newcommand{\lemref}[1]{Lemma~\protect\ref{#1}}
\newcommand{\clmref}[1]{Claim~\protect\ref{#1}}
\newcommand{\corref}[1]{Corollary~\protect\ref{#1}}
\newcommand{\fctref}[1]{Fact~\protect\ref{#1}}
\newcommand{\eqnref}[1]{Equation~(\protect\ref{#1})}
\newcommand{\algref}[1]{Algorithm~(\protect\ref{#1})}
\newcommand{\remref}[1]{Remark~\protect\ref{#1}}
\newcommand{\proref}[1]{Protocol~\protect\ref{#1}}
\newcommand{\stpref}[1]{Step~\protect\ref{#1}}


\newenvironment{boxfig}[2]{\begin{figure}[#1]\fbox{\begin{minipage}{\linewidth}
                        \vspace{0.2em}
                        \makebox[0.025\linewidth]{}
                        \begin{minipage}{0.95\linewidth}
            {{
                        #2 }}
                        \end{minipage}
                        \vspace{0.2em}
                        \end{minipage}}}{\end{figure}}

%Constructions template
\newcommand{\ccconstruction}[4]{
	\begin{boxfig}{h!}{
			\begin{center}
				\textbf{#1}
			\end{center}
			#4
			\vspace{0.2em} } \caption{\label{#3} #2}
	\end{boxfig}
}

\newcommand{\cconstruction}[4]{
	\ccconstruction{#1}{#2}{#3}{#4} }


%Protocols template
\newcommand{\pprotocol}[4]{
% \begin{boxfig}{H}{
\begin{boxfig}{h!}{
\begin{center}
\textbf{#1}
\end{center}
    #4
\vspace{0.2em} } \caption{\label{#3} #2}
\end{boxfig}
}

\newcommand{\protocol}[4]{
\pprotocol{#1}{#2}{#3}{#4} }
%Example:
%\protocol{Header}{Caption}{label}{the protocol}


%general
\newcommand{\negl}{\mathrm{negl}}
\newcommand{\bigslant}[2]{{\raisebox{.2em}{$#1$}\left/\raisebox{-.2em}{$#2$}\right.}}
\newcommand{\bb}{\mathbb}
\newcommand{\ve}[1]{\langle #1 \rangle}
\newcommand{\samp}[1]{\overset{#1}{\leftarrow}}
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\labs}{\left |}
\newcommand{\rabs}{\right |}
%\renewcommand{\)}{\right )}
%\renewcommand{\]}{\right ]}
%\renewcommand{\(}{\left (}
%\renewcommand{\[}{\left [}
\newcommand{\pST}{\; \middle\vert \;}
\newcommand{\malC}{C^*}
\newcommand{\VIEW}{\mathsf{VIEW}}
\newcommand{\Sim}{\mathsf{Sim}}

\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}

%============= FS macros =================%

\newcommand{\I}{\mathds{1}}
\newcommand{\norm}[1]{\ensuremath{\left\lVert #1 \right\rVert}} %
\newcommand{\tr}{Tr} %
\newcommand{\inp}[2]{\ensuremath{\left\langle#1,#2\right\rangle}} %
%\newcommand{\Lin}{\setft{L}} %
\newcommand{\qc}{\approx_c}
\newcommand{\qs}{\approx_s}
\newcommand{\zknp}{\pi_{zk}}
\newcommand{\winp}{\pi_{wi}}
\newcommand{\setft}[1]{\mathrm{#1}}
%\newcommand{\linop}[1]{\setft{L}\left(#1\right)}
\newcommand{\rspace}[1]{\mathsf{#1}}
\newcommand{\rspacen}[1]{\mathsf{#1}_{n}}
\newcommand{\density}[1]{\setft{D}\left(#1\right)}
\newcommand{\ppt}{\textsf{PPT}}
\newcommand{\qpt}{\textsf{QPT}}
\newcommand{\adversary}{A}
\newcommand{\simulator}{S}
\def\X{\mathcal{X}} %
\def\Y{\mathcal{Y}} %
\def\Z{\mathcal{Z}} %
\def\W{\mathcal{W}} %
\def\A{\mathcal{A}} %
\def\B{\mathcal{B}} %
%==============================%
\renewcommand{\paragraph}[1]{\smallskip\noindent{\bf #1}}

\title{Unitary Closed Timelike Curves can Solve all of NP}


\ifllncs
\else

\author{Omri Shmueli\thanks{Tel Aviv University, \texttt{omrishmueli@mail.tau.ac.il}. Supported in part by the European Research Council (ERC) under the European Union’s Horizon Europe research and innovation programme (grant agreement No. 101042417, acronym SPP), and by the Clore Israel Foundation.}}

\date{\vspace{-5ex}}

\date{}

\fi

\begin{document}

\maketitle

\vspace{-1.1cm}

\input{abstract}

\ifllncs
\pagestyle{plain}
\else

\thispagestyle{empty}
\newpage
\tableofcontents
\newpage
\thispagestyle{empty}

\fi

\pagenumbering{arabic}

\input{introduction}

\input{preliminaries}

\input{process_matrix_computation}

\input{SAT}





\paragraph{Acknowledgements}

\vspace{2mm}
\noindent
We are grateful to Mateus Araujo, for clarifications and insightful discussions during the writing of this work.

\ifllncs
\bibliographystyle{plain}
\else
\bibliographystyle{alpha}
\fi

\bibliography{bibliography,abbrev0}

\end{document}


\begin{abstract}
Born in the intersection between quantum mechanics and general relativity, indefinite causal structure is the idea that in the continuum of time, some sets of events do not have an inherent causal order between them. Process matrices, introduced by Oreshkov, Costa and Brukner (\textit{Nature Communications, 2012}), define quantum information processing with indefinite causal structure -- a generalization of the operations allowed in standard quantum information processing, and to date, are the most studied such generalization.

Araujo et al. (\textit{Physical Review A, 2017}) defined the computational complexity of process matrix computation, and showed that polynomial-time process matrix computation is equivalent to standard polynomial-time quantum computation with access to a weakening of post-selection Closed Timelike Curves (CTCs), that are restricted to be \emph{linear}. Araujo et al. accordingly defined the complexity class for efficient process matrix computation as $\BQPlctc$ (which trivially contains $\BQP$), and posed the open question of whether $\BQPlctc$ contains computational tasks that are outside $\BQP$.

In this work we solve this open question under a widely believed hardness assumption, by showing that $\NP \subseteq \BQPlctc$. Our solution is captured by an even more restricted subset of process matrices that are purifiable (\textit{Araujo et al., Quantum, 2017}), which (1) is conjectured more likely to be physical than arbitrary process matrices, and (2) is equivalent to polynomial-time quantum computation with access to \emph{unitary} (which are in particular linear) post-selection CTCs. Conceptually, our work shows that the previously held belief, that non-linearity is what enables CTCs to solve NP, is false, and raises the importance of understanding whether purifiable process matrices are physical or not.
\end{abstract}


\section{Introduction} \label{section:introduction}
One of the basic questions in our understanding of nature, is whether there exists a global causal structure of events in reality. The application of the uncertainty principle from quantum mechanics to the concept of spacetime from general relativity, raises the possibility for an Indefinite Causal Structure (ICS), which in turn would yield a negative answer to the above question. The Process Matrix Formalism (PMF) \cite{oreshkov2012quantum}, introduced by Oreshkov, Costa and Brukner, is a well-known example for ICS in the scope of quantum information theory. The PMF is a generalization of quantum information processing, that enables the definition of a quantum channel such that for a subset of its operations, the execution order is indefinite (this is a generalization of standard quantum information processing, because we can always define a channel with no indefinite regions).

At the heart of the PMF lie Process Matrices (PMs), which define the legal quantum operations in the PMF. One view of a Process Matrix (PM) $W$ is as an operator on quantum channels, that for an input channel $\channel_{0}$ outputs a new channel $W\left( \channel_{0} \right) := \channel_{1}$. Intuitively, the mapping $\channel_{0} \rightarrow \channel_{1}$ is given by removing some causality constraints from the execution of $\channel_{0}$, such that the (partial) removal of causality still keeps the output transformation $W\left( \channel_{0} \right)$ a valid quantum channel\footnote{Most generally, the PM $W$ can also add general quantum transformations to its output channel, independently from the input $\channel_{0}$.}. In order to think about $W$ as a quantum channel (and not as a superoperator), one can fix the input channel $\channel_{0}$ for $W$ to be the identity operator.

%When considering PMs as quantum channels, the set of transformations allowed by PMs, compared to the set of transformations allowed by the quantum circuit model, are identical: These is just the set of all valid quantum channels (in other words, the set of all completely positive, trace-preserving (CPTP) linear maps on the sets of Hilbert spaces with appropriate dimensions).
In the same way that it is possible to assign a notion of computational complexity to a quantum circuit, it is possible to assign computational complexity to a PM, and it was accordingly shown in \cite{araujo2017quantum} how to define PM polynomial-time computation as a computational model. PM polynomial-time computation is at least as strong as (standard) quantum polynomial-time computation, and from the point of view of information processing, the hope is that it can allow for advantages in complexity and communications tasks.

\subsection{Information Processing based on Process Matrices - Previous Work} \label{subsection:information_processing_with_PMs}
There is a large body of work exploring the information processing capabilities of PMs (c.f. \cite{oreshkov2012quantum, chiribella2012perfect, araujo2014computational, araujo2014quantum, baumeler2014perfect, baumeler2014maximal, branciard2015simplest, araujo2015witnessing, oreshkov2016causal, guerin2016exponential, araujo2017purification, zhao2020quantum, guha2020thermodynamic, felce2020quantum, chiribella2021indefinite, wechs2021quantum}), and PM polynomial-time computation was shown to be superior to quantum computation for numerous tasks.

PM computation violates what's known as causal inequalities\footnote{Causal inequalities mainly stem from multi-party communication games, with known lower bounds when using standard quantum information processing.} \cite{oreshkov2012quantum, baumeler2014perfect, baumeler2014maximal, branciard2015simplest, araujo2015witnessing, oreshkov2016causal}. PM computation is also known to implement an oracle called quantum switch, introduced in \cite{chiribella2013quantum}.
%The (single-qubit) Quantum Switch is a process that exemplifies computation with ICS. The switch gets oracle access to two quantum channels $\Phi$, $\Psi$, and a single-qubit register $R$, and applies an $R$-conditioned superposition of the orderings of the channels, crucially, using a single query to each of the channels. The switch can be generalized to an $n$-qubit register $R$ (and $\approx 2^{n}$ different orderings of $n$ channels).
Without getting to the definition of the ($n$-qubit) quantum switch oracle, while it is known that the standard quantum circuit model in quantum mechanics cannot simulate the quantum switch with no overhead, PMs are known to exactly implement the single-qubit case \cite{araujo2017purification} and the $n$-qubit case \cite{araujo2017quantum}.

The quantum switch provides a \emph{polynomial} speedup for some oracle problems \cite{araujo2014computational} making a quadratic improvement from a lower bound of $\Omega\left( n^{2} \right)$ in standard quantum computation, to an algorithm of $O\left( n \right)$ queries when using the switch oracle. The quantum switch also enables an advantage in discriminating quantum channels \cite{chiribella2012perfect}, advantage in communication complexity tasks \cite{guerin2016exponential}, quantum metrology \cite{zhao2020quantum}, and enables computing on thermalized quantum states under some conditions \cite{guha2020thermodynamic}. Due to the ability of PMs to execute the switch, the above advantages are also applicable under PM computation. Still, all of the previous advantages described above give only polynomial speedups over quantum computation.





\subsection{Linear Closed Timelike Curves as Process Matrices} \label{subsection:PMs_physical_meaning}
Araujo, Guerin and Baumeler \cite{araujo2017quantum} gave a complete interpretation of the physicality of PMs, by showing their equivalence to a uniquely restricted case of Closed Timelike Curves (CTCs). We next give a brief introduction to CTCs, and then explain their connection to PMs.

\paragraph{Detour -- Closed Timelike Curves in Quantum Mechanics.}
CTCs, first discovered in \cite{van1938ix, godel1949example}, describe a region of $4$-dimensional spacetime that is closed on itself, creating a loop. The discovery of CTCs has meant that their existence does not create logical contradictions with Einstein's theory of general relativity\footnote{The relation between CTCs and general relativity carries a resemblance to the relation between PMs and quantum mechanics -- while the physicality of PMs is unknown, it is logically consistent with quantum mechanics.}, and the question of whether CTCs physically exist or not, is still an open one \cite{morris1988wormholes, novikov1989analysis, hawking1992chronology}.

There are two studied definitions for CTCs in the literature of quantum mechanics, and both refer to a CTC as a transformation on quantum states.
\begin{itemize}
    \item
    Deutschian CTCs:
    Deutsch \cite{deutsch1991quantum} proposed a quantum mechanical definition for CTCs, describing their action on an input in the form $\rho_{A} \otimes \rho_{CTC}$ (for two $n$-qubit states) as $\tr_{CTC}\left( U \left( \rho_{A} \otimes \rho_{CTC} \right) U^{\dagger} \right)$. For the transformation to be executed, $\rho_{CTC}$ needs to be what's called a fixed-point state of the CTC and satisfy that for every $n$-qubit state $\rho_{A}$ we have $\rho_{CTC} = \tr_{A}\left( U \left( \rho_{A} \otimes \rho_{CTC} \right) U^{\dagger} \right)$. 

    Deutschian CTCs are non-unitary, non-linear transformations on quantum states. They were shown to be able to perfectly distinguish non-orthogonal states \cite{brun2009localized}, to clone quantum states \cite{ahn2013quantum, brun2013quantum}, violate Heisenberg's uncertainty principle \cite{pienaar2013open} and lead to a computational model that allows the solution of the entire complexity class PSPACE with polynomial-time resources \cite{aaronson2009closed}. 

    \item
    Post-selection CTCs (P-CTCs):
    Introduced in a series of works \cite{politzer1994path, bennett2005teleportation, svetlichny2011time, lloyd2011closed}, a different quantum mechanical definition for CTCs is based on post-selection and normalization. Specifically, instead of looking on a unitary operation $U$ inside the CTC and then applying the transformation to the bipartite state on the systems $(A, CTC)$ (which is the case in Deutschian CTCs), in P-CTCs we take the partial trace $M := \tr_{CTC}\left( U \right)$ of the unitary $U$ itself, apply $M$ to the input state, and normalize:
    $$
    \rho_{out}
    := \frac{ M \cdot \rho_{A} \cdot M^{\dagger} }{ \tr\left( M \cdot \rho_{A} \cdot M^{\dagger} \right) }
    \enspace .
    $$
    Tracing out the subsystem $CTC$ from the unitary $U$, where $U$ operates on the two (spatially disjoint) registers $\left( A, CTC \right)$, intuitively captures the notion that in the spacetime region of the register $CTC$, "the input returns to itself". Since the matrix $M$ is not necessarily unitary anymore, in order to return $M \cdot \rho_{A} \cdot M^{\dagger}$ to be a valid quantum state, we normalize.
    
    While P-CTCs seem a bit less dramatic in computational power than Deutschian CTCs, they do keep some of the core properties: P-CTCs are also non-unitary and non-linear transformations\footnote{The non-linearity is due to the state-dependant normalization factor $\tr\left( M \cdot \rho_{A} \cdot M^{\dagger} \right)$, which one can also observe is sometimes undefined, when the trace equals $0$.}, they were shown to perfectly distinguish non-orthogonal quantum states \cite{brun2012perfect}, and enable a computational model that solves the entire (seemingly smaller than PSPACE, but still huge) complexity class PP using polynomial-time resources \cite{lloyd2011closed, lloyd2011quantum}.
\end{itemize}

\paragraph{Linear Closed Timelike Curves and their Connection to Process Matrices.}
We now go back to our original motivation in this Section, which is the physical meaning behind PMs. Araujo et al. \cite{araujo2017quantum} considers a restricted case of \emph{linear} P-CTCs. As a simplified description, imagine a case of P-CTCs where $M := \tr_{CTC}\left( U \right)$ is such that the normalization factor $\tr\left( M \cdot \rho_{A} \cdot M^{\dagger} \right)$ is constant (and non-zero) over all $n$-qubit states $\rho_{A}$. For such restricted case of $M$ (which follows from the properties of the original unitary $U$, acting on the full system $\left( A, CTC \right)$), the CTCs are linear transformations on $n$-qubit mixed states.

Araujo et al. show an equivalence between two computational models: (1) PM polynomial-time computation, and (2) standard quantum polynomial-time algorithms with access to linear P-CTCs (as described above). Due to the equivalence between PMs and linear P-CTCs, for the remainder of the Introduction we will interchangeably refer to PM polynomial-time computation and quantum polynomial-time computation with access to linear CTCs. Finally, Araujo et al. denote by $\BQPlctc$ the class of decision problems that are solvable by a quantum polynomial-time algorithm with access to linear P-CTCs (or equivalently, solvable by PM polynomial-time algorithms). The authors of \cite{araujo2017quantum} pose the open problem of understanding how much processing power linear P-CTCS add to quantum polynomial-time computation, or equivalently, what is the relation between the complexity classes $\BQP$ and $\BQPlctc$, other than the trivial $\BQP \subseteq \BQPlctc$.





\subsection{Purification Postulate as Physicality Condition for PMs (and CTCs)}
Araujo, Feix, Navascues and Brukner \cite{araujo2017purification} formulated a purification predicate, and hypothesized that processes are physical if and only if they satisfy the predicate. More precisely, \cite{araujo2017purification} postulates that a PM computation is physical iff it is \emph{purifiable}. Intuitively, purification is analogous to its meaning in standard quantum computation: Behind every quantum channel $\channel$ there is a generalized, pure channel $\channel_{U}$, which implements $\channel$ but is also unitary and reversible\footnote{The unitary channel $\channel_{U}$ usually acts on a larger quantum system, and implements $\channel$ as a private case.}. In particular, if the PM $W$ maintains unitarity in the transition $\channel_{0} \rightarrow \channel_{1}$, then the process should be physical according to the purification postulate.

By converging both, (1) the notion of PMs as linear CTCs and (2) PMs being physical iff they are purifiable, we get an even more restricted case of P-CTCs. Specifically, one can consider \emph{unitary} P-CTCs, where the derived CTC matrix $M := \tr_{CTC}\left( U \right)$ is unitary. According to the \cite{araujo2017purification} purification postulate, such CTCs may be physical. In the scope of this paper we denote an additional complexity class, $\BQPuctc$, as the class of decision problems which are solvable by a quantum polynomial-time algorithm with access to a unitary P-CTC. Note that it immediately follows that $\BQP \subseteq \BQPuctc \subseteq \BQPlctc$.

Given the previous work on Process Matrices and Closed Timelike Curves, and given the unification of these two notions, understanding the relationship between $\BQP$ and $\BQPlctc$ (and possibly $\BQPuctc$) is a natural question in quantum information processing and computational complexity theory, which we explore in this paper.





\subsection{Results}
We resolve the above open question from \cite{araujo2014quantum} under the widely believed complexity theoretical assumption, that $\NP \nsubseteq \BQP$, by proving the following.

\begin{theorem} [Main Theorem]
    $\NP \subseteq \BQPuctc$ (as per Definition \ref{definition:BQPuctc}).
\end{theorem}

That is, we prove that quantum polynomial-time computation with access to unitary post-selection CTCs (or equivalently, polynomial-time purifiable process matrices\footnote{Recall that purifiable process matrices, sometimes referred to simply as purifiable processes, are process matrices which satisfy the purification postulate of \cite{araujo2017purification}.}) can solve all of NP. Since $\BQPuctc \subseteq \BQPlctc$, the following Corollary immediately follows.

\begin{corollary} [Main Corollary]
    $\NP \subseteq \BQPlctc$ (as per Definition \ref{definition:BQPlctc}).
\end{corollary}

Technically, our proof has two concurrent steps: (1) Identifying the right problem in $\NP$, and (2) finding a unitary CTC quantum algorithm for it. Conceptually, our work proves that the previous understanding about P-CTCs and the complexity class $\NP$, which hypothesized that the reason that P-CTCs can solve $\NP$ is their non-linearity, was false. Finally, since we show that purifiable process matrices \cite{araujo2017purification} can efficiently solve significant new problems, the question regarding the physicality of pure process matrices is now well motivated.





\subsection{Technical Overview} \label{subsection:technical_overview}
In this section we explain the main technical steps for showing how quantum polynomial-time computation with access to unitary post-selection CTCs (from hereon, simply referred to as unitary CTCs) can solve $\SAT$. 

\paragraph{Quantum Computation with Access to Unitary CTCs -- Computational Model.}
We start with defining $\BQPuctc$ (Definition \ref{definition:BQPuctc}), the complexity class of polynomial-time quantum computation with access to unitary post-selection CTCs. Our definition is analogous to the definition of the class $\BQPlctc$ (capturing the more general linear, rather than only unitary, post-selection CTCs) from previous work, and we give a formal comparison in Section \ref{subsubsection:computation_with_linear_CTCs}. 

We first define the operation $\GenCTC$, which is the generator of unitary CTCs: The input of $\GenCTC$ is a pair $\left( m, C \right)$ for $m \in \Nat$ and a quantum circuit $C$ that maps from $(m + r)$ to $(m + r)$ qubits, for some $r \in \Nat$ (possibly using an additional ancilla of $k \in \Nat$ qubits assisting the computation). The complexity of executing $\GenCTC$ is counted as $\Theta(|C|)$. If the following two conditions are met, the CTC generation is successful: (1) $C$ induces a unitary channel $U_{C} \in \bbC^{ 2^{m + r} \times 2^{m + r} }$ on $\left( m + r \right)$-qubit states, and (2) the $2^m$-partial trace of $U_{C}$, denoted $V_{\left( m, C \right)} := \tr_{m}\left( U_{C} \right) \in \bbC^{ 2^{r} \times 2^{r} }$, is also unitary. If the CTC generation succeeds, then we get oracle access to the $r$-qubit unitary quantum channel $V_{\left( m, C \right)}$, where each query to $V_{\left( m, C \right)}$ costs $O(1)$ time. In case a call $\left( m, C \right)$ to $\GenCTC$ fails, for the sake of this overview, the reader can regard the result as producing a fail $\bot$ signal\footnote{The information of whether a call to $\GenCTC\left( m, C \right)$ has succeeded or failed is not necessarily efficiently quantumly computable given $\left( m, C \right)$, and we do not assume what happens in a failed generation attempt. In order to make the model as conservative as possible, in the full definition of $\BQPuctc$, the call $\GenCTC\left( m, C \right)$ always produces access to \emph{some} channel $\channel$, and only if the CTC generation succeeded then we are guaranteed that $\channel = V_{\left( m, C \right)}$. If the generation failed, then $\GenCTC$ does not explicitly let us know that the generation failed, and $\channel$ can be arbitrary and even chosen adversarially against us.}. The complexity class $\BQPuctc$ is the set of decision problems such that there exists a quantum polynomial-time Turing Machine $M$ with access to the operation $\GenCTC$ (and the channels that the CTC generator produces), that given any $x \in \{ 0, 1 \}^{*}$ correctly decides $x$ with probability $\geq 1 - 2^{-|x|}$.

\paragraph{Computational Advantage for Unitary Closed Timelike Curves.}
As said, we not only aim to show a (super-polynomial) computational advantage of $\BQPuctc$ over $\BQP$, but an algorithm for all of $\NP$. The natural strategy for solving all of $\NP$ is to try to solve an $\NP$-complete problem, or equivalently\footnote{It is known that for $\NP$-complete problems, the seemingly harder search versions are in fact equivalent to the decision versions of the problems.}, to solve a search version of an $\NP$-complete problem. A search problem is formally defined by a relation $\Rel \subseteq \left( X \times Y \right)$ for $X, Y \subseteq \{ 0, 1 \}^{*}$. Given $x \in X$ ($X$ is the instance set), a solving algorithm for the search problem needs to find a $y \in Y$ ($Y$ is the solution set) such that $\left( x, y \right) \in \Rel$. A search problem is solvable in $\BQPuctc$ if there is a quantum polynomial-time Turing Machine $M$ with access to the operation $\GenCTC$, such that given any $x \in X$, finds $y \in Y$ such that $\left( x, y \right) \in \Rel$.

We did not find a way to directly solve $\NP$-complete problems (or their search versions) with unitary CTCs. The key to our solution is by observing that a connecting component between the class $\NP$ and unitary CTCs is the search problem $\USAT$. $\USAT$ is the search problem where the set $X$ is the set of all CNF formulas with \emph{exactly one} satisfying assignment. The set $Y$ contains the corresponding unique assignments: For every $\varphi \in X$, the string $z$ is in $Y$ iff $\varphi\left( z \right) = 1$. $\USAT$ is a relaxation of $\SAT$, an $\NP$-complete problem, but itself is not known to be $\NP$-complete. 
\begin{itemize}
    \item  
    The hardness of $\USAT$ is an interesting subject in complexity theory. In terms of Karp reductions (the standard reductions in complexity), $\USAT$ is at least as hard as some important (though, not $\NP$-complete) problems. For example, the search version of the Learning with Errors $\LWE$ problem \cite{regev2009lattices}, which in turn is a standard hardness assumption for polynomial-time quantum algorithms, is Karp-reducible to $\USAT$. To easily see why $\LWE \leq_{p} \USAT$, recall that an instance of search $\LWE$ includes a basis $\Basis_{\Lattice} \in \bbZ_{q}^{m \times n}$ ($m = \poly(n)$ for some polynomial $\poly(\cdot)$) for a random rank-$n$ lattice $\Lattice \subseteq \bbZ_{q}^{m}$, accompanied by a vector $\tVector = \Basis_{\Lattice} \cdot \sVector + \eVector$ inside $\bbZ_{q}^{m}$, for a secret coordinates vector $\sVector \in \bbZ_{q}^{n}$ and a short vector $\eVector \in \bbZ_{q}^{m}$. In particular, $|\eVector|$ is smaller than half the length of the shortest non-zero vector in $\Lattice$, which makes the solution to the search problem, $\sVector$, unique.

    \item 
    We show there is a $\BQPuctc$ algorithm for $\USAT$.

    \item 
    Even though $\USAT$ is not $\NP$-complete, which means it isn't complete in terms of Karp reductions, it is practically "as good as" $\NP$-complete. Formally, there is a known probabilistic Turing reduction \cite{valiant1985np} from $\SAT$ to $\USAT$, allowing us to complete the connection between the entire class $\NP$ and $\BQPuctc$.
\end{itemize}

\paragraph{Unitary CTCs can Find Exactly One Needle in a Haystack.}
We next describe a search algorithm in $\BQPuctc$ for the search problem $\USAT$. Given an input $\varphi \in \USAT$ a CNF formula with $n$ input Boolean variables and exactly one satisfying assignment $z \in \{ 0, 1 \}^{n}$, the quantum polynomial-time Turing Machine $M$ executes as follows: $M\left( \varphi \right)$ computes the pair $\left( m, C \right)$ for $m := n$, and $C := C_{\varphi}$ is a quantum circuit from $2n$ qubits to $2n$ qubits, that for $x, y \in \{ 0, 1 \}^{n}$, executes as follows on input $\ket{x, y}$:
\begin{enumerate}
    \item
    Denote the first $n - 1$ bits of $x \in \{ 0, 1 \}^{n}$ with $x_{1, \cdots, n - 1}$, and we check if $x_{1, \cdots, n - 1}$ can be completed to the satisfying assignment. Formally, check whether $\varphi\left( x_{1, \cdots, n - 1}, 0 \right) = 1$ or $\varphi\left( x_{1, \cdots, n - 1}, 1 \right) = 1$, where we are guaranteed that either both completions fail or exactly one succeeds. In case of success, we denote with $\left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) \in \{ 0, 1 \}^{n}$ the satisfying assignment and write $x \sim \varphi$. Importantly, observe that whether $x \sim \varphi$ or not can be computed efficiently (given $\varphi$) without looking on the last (rightmost) bit $x_n$ of $x$. 
    
    \item 
    If $x \sim \varphi$:
    \begin{enumerate}
        \item
        Let $y \in \{ 0, 1 \}^{n}$ the right $n$ qubits of the input of $C$.
        Add modulo $2$ the string $\left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right)$ to $y$ to get $y \oplus \left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right)$ in the right input register.

        \item 
        Execute $R_{\frac{1}{2}}$ on the qubit $x_{n}$, where $R_{\frac{1}{2}}$ is the single-qubit gate:
        $$
        R_{\frac{1}{2}}
        :=
        \begin{pmatrix}
            \frac{1}{2} & -\sqrt{ \frac{3}{4} } \\
            \sqrt{ \frac{3}{4} } & \frac{1}{2}   
        \end{pmatrix}
        \enspace .
        $$
    \end{enumerate}

    \item 
    Else, $\lnot \left( x \sim \varphi \right)$:
    \begin{enumerate}
        \item
        Execute a bit flip gate $X$ on $x_{n}$.
    \end{enumerate}
\end{enumerate}

It can be verified that $C$ is a unitary quantum circuit, and induces the $2n$-qubit unitary $U_{C} \in \bbC^{2^{2n} \times 2^{2n}}$:
$$
\sum_{ x, y \in \{ 0, 1 \}^{n} : x \sim \varphi }
\ket{x_{1, \cdots, n - 1}}
\otimes
\left( \frac{1}{2}\cdot\ket{x_n} + (-1)^{x_n} \sqrt{ \frac{3}{4} } \cdot \ket{\lnot x_{n}} \right)
\otimes
\ket{ y \oplus \left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) }
\bra{ x, y }
$$
$$
+
\sum_{ x, y \in \{ 0, 1 \}^{n} : \lnot \left( x \sim \varphi \right) }
\ket{x_{1, \cdots, n - 1}, \lnot x_{n}, y}
\bra{ x, y }
\enspace .
$$
One can further verify by calculation that $V_{\left( n, C \right)} := \tr_{n}\left( U_{C} \right) \in \bbC^{ 2^{n} \times 2^{n} }$ equals:
$$
\sum_{ x, y \in \{ 0, 1 \}^{n} : x \sim \varphi }
\frac{1}{2}
\cdot
\ket{ y \oplus \left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) }
\bra{ y }
+
\sum_{ x, y \in \{ 0, 1 \}^{n} : \lnot \left( x \sim \varphi \right) }
0
\cdot 
\ket{ y }
\bra{ y }
\enspace .
$$
Recall that because $\varphi$ has a unique satisfying assignment we are guaranteed there are exactly two $x, x' \in \{ 0, 1 \}^{n}$, $x \neq x'$ such that $x \sim \varphi$, $x' \sim \varphi$, and also $\left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) = \left( x'_{1, \cdots, n - 1}, b^{\left( x' \right)} \right) = z$. It follows that the above $V_{\left( n, C \right)} := \tr_{n}\left( U_C \right)$ equals
$$
\sum_{ y \in \{ 0, 1 \}^{n} } \ket{ y \oplus z }\bra{ y }
\enspace .
$$
The above implies that $V_{\left( n, C \right)}$ is a unitary matrix, which makes the CTC generation query $\GenCTC\left( n, C \right)$ successful. The CTC generation opens oracle access to the channel $V_{\left( n, C \right)}$, which in turn just adds (in superposition) the unique satisfying assignment $z$ into the input state. Finally, after the CTC generation, $M$ simply sends the single query $\ket{0^n}$ to the channel $V_{\left( n, C \right)}$ to get back $\ket{z}$.

\paragraph{Extending the solution to $\SAT$.} 
By using our above algorithm $M_{\USAT}$ for $\USAT$ together with known techniques, we extend the solution to $\SAT$. We use the well-known Valiant-Vazirani algorithm \cite{valiant1985np}, which is a classical probabilistic polynomial-time algorithm $T_{VV}$ with the following guarantee: Let $\varphi$ an arbitrary CNF formula on $n$ Boolean variables. The output $\varphi^{*} \gets T_{VV}\left( \varphi \right)$ is a new CNF formula, also on $n$ Boolean variables, such that (1) if $\varphi$ was not satisfiable then with probability $1$ over the randomness of $T_{VV}$, the formula $\varphi^{*}$ is also not satisfiable, and (2) if $\varphi$ was satisfiable then with probability $\Omega\left( \frac{1}{n} \right)$ over the randomness of $T_{VV}$, the formula $\varphi^{*}$ has exactly one satisfying assignment.

Given our $\USAT$ algorithm $M_{\USAT}$ and the Valiant-Vazirani reduction $T_{VV}$, the $\BQPuctc$ algorithm for $\SAT$ is now clear: Given a CNF formula $\varphi$ which is either in $\SAT$ (i.e., has any non-zero number of satisfying assignments) or not, the machine $M$ executes the following procedure $n^2$ times, independently: Execute $\varphi^{*} \gets T_{VV}\left( \varphi \right)$ and then $z' \gets M_{\USAT}\left( \varphi^{*} \right)$. At each iteration, $M$ checks whether $\varphi^{*}\left( z' \right) = 1$ and if so, accepts the original input $\varphi$. If all $n^2$ attempts failed, $M$ rejects $\varphi$.

The following could be easily verified: In case $\varphi \notin \SAT$ then (by the correctness of $T_{VV}$) with probability $1$ the formula $\varphi^{*}$ is not satisfiable, and the algorithm $M$ will always reject $\varphi$ (because over all $n^2$ attempts, there does not exist a satisfying assignment for $\varphi^{*}$). In case $\varphi \in \SAT$ then for each of the $n^2$ iterations, $\varphi^{*}$ is in $\USAT$ with probability at least $\Omega\left( \frac{1}{n} \right)$. In the case of a successful execution of $T_{VV}$, then by the correctness of the algorithm $M_{\USAT}$, we have $\varphi^{*}\left( z' \right) = 1$, and $M$ will accept $\varphi$. Since $M$ makes $n^2$ attempts and each attempt succeeds with probability $\Omega\left( \frac{1}{n} \right)$, the machine $M$ will accept $\varphi$ with probability $\geq 1 - 2^{-\Omega\left( n \right)}$.



\section{Preliminaries} \label{section:preliminaries}
We use the following known standard notions and notations from classical and quantum computation in this work.

\begin{itemize}
    \item
    For $n \in \Nat$, define $[n] := \{ 1, 2, 3, \cdots, n \}$.

    \item 
    $\{ 0, 1 \}^{*} := \bigcup_{ i \in \left( \Nat \cup \{ 0 \} \right) } \{ 0, 1 \}^{i}$ is the set of all binary strings, of all lengths.

    \item 
    When we use the notation $\log(\cdot)$ we implicitly refer to the base-$2$ logarithm function $\log_{2}(\cdot)$, unless explicitly noted otherwise.

    \item 
    When we use the notation $\norm{ \cdot }$ for norm of a vector, we implicitly refer to the Euclidean, or $\ell_{2}$ norm $\norm{ \cdot }_{2}$, unless explicitly noted otherwise.

    \item 
    For $n \in \Nat$, we define the $n$-qubit state space, denoted $\states\left( n \right)$, to be the set $\bbC^{2^{n}}$ of all $2^n$-dimensional complex vectors, along with the vector dot product acting as an inner product for the space. In particular, it is known that $\states\left( n \right)$ is a $2^{n}$-dimensional Hilbert space, and that the subset of unit vectors in $\states\left( n \right)$ corresponds to the set of all $n$-qubit pure quantum states.

    \item 
    For $n \in \Nat$, the set of $n$-qubit mixed quantum states is the set of density matrices $\rho$ of dimension $2^{n}$. An $n$-qubit mixed state corresponds to a classical distribution over $n$-qubit pure states, with either a finite or infinite support set.

    \item 
    For $n, m \in \Nat$, an $n$ to $m$ (general) quantum circuit is a quantum circuit $C$ with input an $n$-qubit mixed state, can perform any quantum gate from any constant-size set of single-qubit gates, the two-qubit quantum gates $\{ CNOT, SWAP \}$ and three-qubit Toffoli gate $Tof$, execute measurement gates and add ancillary qubit registers containing $\ket{0}$, where each of the above operations costs $\Theta\left( 1 \right)$ time. At the end of the execution, $C$ outputs an $m$-qubit mixed state.

    \item 
    For $n \in \Nat$, an $n$-qubit unitary circuit is an $n$ to $n$ quantum circuit such that there exists a unitary matrix $U_{C} \in \bbC^{ 2^{n} \times 2^{n} }$ such that for every $n$-qubit pure state $\ket{\psi}$ the action of $C$ corresponds to the action of the unitary, that is, $C\left( \ket{\psi} \right) = U_{C} \cdot \ket{\psi}$.
\end{itemize}

\subsection{Standard Notions from Computational Complexity Theory}
We define Promise Problems, Decision Problems and Languages, all are standard notions from computational complexity theory.

\begin{definition} [Promise Problem]
    A promise problem $\prod := \left( \YES , \NO \right)$ is given by two (possibly infinite) sets $\YES \subseteq \{ 0, 1 \}^{*}$, $\NO \subseteq \{ 0, 1 \}^{*}$ such that $\YES \cap \NO = \emptyset$.
\end{definition}

Put simply, a decision problem (defined below) is a promise problem where the input can be any string, and is not promised to be in any particular set.

\begin{definition} [Decision Problem]
    Let $\prod := \left( \YES , \NO \right)$ a promise problem. We say that $\prod$ is a decision problem if $\YES \cup \NO = \{ 0, 1 \}^{*}$.
\end{definition}

\begin{definition} [Language]
    Let $\prod := \left( \YES , \NO \right)$ a decision problem. We say that $\lang$ is the language induced by the decision problem $\prod$ if $\YES = \lang$. 
\end{definition}

The complexity class $\BQP$ represents all computational problems that have a polynomial-time solution on a quantum computer. The writing $\BQP$ stands for Bounded-Error Quantum Polynomial-Time, and is defined as follows. We implicitly refer to the promise version of $\BQP$ in this work (the version containing only decision problems does not have a complete problem, while the promise version of $\BQP$ has natural complete problems).

\begin{definition} [The Complexity Class $\BQP$]
    The complexity class $\BQP$ is the set of promise problems $\prod := \left( \YES , \NO \right)$ that are solvable by a quantum polynomial-time algorithm. Formally, such that there exists a quantum polynomial-time Turing Machine $M$ such that for every $x \in \YES$, $M(x) = 1$ with probability at least $p(x)$, and for every $x \in \NO$, $M(x) = 0$ with probability at least $p(x)$, such that
    $$
    \forall x \in \left( \YES \cup \NO \right) : p(x) \geq 1 - 2^{-|x|} \enspace .
    $$
\end{definition}

\paragraph{The Satisfiability Problem $\SAT$.}
We define the satisfiability problem $\SAT$, which is known to be $\NP$-complete \cite{karp2010reducibility}. Recall that $\SAT$ is a decision problem and in the below definition, the input is an arbitrary binary string in $\{ 0, 1 \}^{*}$, which is then interpreted as a CNF formula $\varphi$. In case the input is not in the correct format to be interpreted as a CNF formula (which can be checked by a classical efficient algorithm) the input is counted as a $\NO$ instance.

\begin{definition} [The Satisfiability Problem] \label{definition:SAT}
    The Satisfiability problem, denoted $\SAT$ is a decision problem, where the input is a CNF formula $\varphi$ with $n$ input Boolean variables. The problem is defined as follows.
    \begin{itemize}
        \item
        $\YES$ is the set of all (binary encodings of) CNF formulas that are satisfiable.

        \item
        $\NO$ is $\{ 0, 1 \}^{*} \setminus \YES$.
    \end{itemize}
\end{definition}

\paragraph{The Valiant-Vazirani Theorem.}
We use the Valiant-Vazirani Theorem \cite{valiant1985np}, which can be stated as follows.

\begin{theorem} [Valiant-Vazirani Theorem] \label{theorem:valiant_vazirani}
    There exists a classical probabilistic polynomial-time Turing machine $T_{VV}$ that gets as input a CNF formula $\varphi$ that has input $n$ Boolean variables, and outputs a CNF formula $\varphi^{*}$ that also has input $n$ Boolean variables, with the following guarantees.
    \begin{itemize}
        \item
        If $\varphi \notin \SAT$ then $\Pr_{ \varphi^{*} \gets T_{VV}\left( \varphi \right) }\left[ 
\varphi^{*} \notin \SAT \right] = 1$.

        \item
        If $\varphi \in \SAT$ then $\Pr_{ \varphi^{*} \gets T_{VV}\left( \varphi \right) }\left[ 
\varphi^{*} \text{ has exactly one satisfying assignment } \right] \geq \Omega\left( \frac{1}{n} \right)$.
    \end{itemize}
\end{theorem}



\section{Process Matrix Computation} \label{section:new_notions_and_definitions}
In this section we provide all definitions for process matrices, process matrix computation, the complexity class $\BQPlctc$ defined in \cite{araujo2017quantum} and our new complexity sub-class $\BQPuctc$. Some of the definitions are from existing literature and some are new versions, presented in this work.

\subsection{Notions in Quantum Information Theory}
We define linear operators over Hilbert spaces. In the scope of this work we will always define Hilbert spaces as complex vector spaces, for different amounts of qubits\footnote{More precisely, we think of Hilbert spaces (with the notation $\Hilb_{A}$) as a variable that takes a value $\states\left( n \right)$ for some $n \in \Nat$. This in particular means that we can have two different Hilbert spaces that capture the same spaces, but describe the states of non-identical physical quantum systems.}.

\begin{definition} [Set of linear operators between two sets]
    Let $A$, $B$ two sets. The set $\Lin\left( A, B \right)$ is defined as the set of all linear transformations from $A$ to $B$.
    \begin{itemize}
        \item 
        In case $A = B$, we write $\Lin\left( A \right)$ for short.
    
        \item
        The identity operator of $\Lin\left( A \right)$ is denoted by $I_{ \Lin\left( A \right) }$.

        \item 
        In case the sets are Hilbert spaces (and in our case, state spaces), then the set of linear operators is the set of appropriate matrices. Formally, if there are $n, m \in \Nat$ such that $\Hilb_{0} = \states\left( n \right)$, $\Hilb_{1} = \states\left( m \right)$, then $\Lin\left( \Hilb_{0}, \Hilb_{1} \right) = \bbC^{ 2^{m} \times 2^{n} }$, and the action of a linear transformation is vector-matrix multiplication, where the matrix is the left multiplicand.
    \end{itemize}
\end{definition}

An operator which we will use extensively in this work is taking the partial trace of a square matrix.

\begin{definition} [Partial trace of an operator] \label{definition:partial_trace}
    Let $n, m \in \Nat$ and a linear operator $M \in \Lin\left( \Hilb_{0} \otimes \Hilb_{1} \right)$ for $\Hilb_{0} = \states\left( n \right)$, $\Hilb_{1} = \states\left( m \right)$, that is, $M \in \bbC^{ 2^{m + n} \times 2^{m + n} }$ is a square matrix. The partial trace of $M$ with respect to $\Hilb_{0}$ is defined as the following matrix in $\bbC^{2^m \times 2^m}$:
    $$
    \tr_{\Hilb_{0}}\left( M \right)
    :=
    \sum_{ x \in \{ 0, 1 \}^{n} }
    \left( \bra{x} \otimes I_{\Lin\left( \Hilb_{1} \right)} \right)
    \cdot M \cdot
    \left( \ket{x} \otimes I_{\Lin\left( \Hilb_{1} \right)} \right)
    \enspace .
    $$
    We can also write $\tr_{n}\left( M \right) := \tr_{\Hilb_{0}}\left( M \right)$.
\end{definition}

\begin{definition} [Quantum channel] \label{definition:quantum_channel}
    Let $\Hilb_{0}$, $\Hilb_{1}$ Hilbert spaces and let $\channel \in \Lin\left( \Lin\left( \Hilb_{0} \right) , \Lin\left( \Hilb_{1} \right) \right)$. We say that $\channel$ is a quantum channel from $\Hilb_{0}$ to $\Hilb_{1}$ if it is a completely positive, trace-preserving (linear) map from $\Lin\left( \Hilb_{0} \right)$ to $\Lin\left( \Hilb_{1} \right)$. In case $\Hilb_{0} = \states\left( n \right)$, $\Hilb_{1} = \states\left( m \right)$ for some $n, m \in \Nat$, we say that $\channel$ is a channel from $n$ to $m$ qubits, or an $n$-to-$m$ quantum channel.
\end{definition}

Throughout this work we use the Choi-Jamiolkowski isomorphism (or CJ isomorphism for short), which for Hilbert spaces $\Hilb_{0}$, $\Hilb_{1}$, induces a bijection between
$$
\Lin\left( \Lin\left( \Hilb_{0} \right), \Lin\left( \Hilb_{1} \right) \right)
\enspace ,
$$
which is the set of linear transformations from $\Lin\left( \Hilb_{0} \right)$ to $\Lin\left( \Hilb_{1} \right)$, and
$$
\Lin\left( \Hilb_{0} \otimes \Hilb_{1} \right)
\enspace ,
$$
which is the set of linear transformations from $\Hilb_{0} \otimes \Hilb_{1}$ to itself.
The CJ isomorphism in particular induces an isomorphism between (1) $n$-to-$m$ quantum channels and (2) a special set of matrices in $\bbC^{2^{n + m} \times 2^{n + m}}$. The CJ isomorphism is defined as follows.

\begin{definition} [Choi-Jamiolkowski operator of a linear operator] \label{definition:cj_isomorphism}
    Let $\channel \in \Lin\left( \Lin\left( \Hilb_{0} \right) , \Lin\left( \Hilb_{1} \right) \right)$ a linear operator for $\Hilb_{0} = \states\left( n \right)$, $\Hilb_{1} = \states\left( m \right)$ for some $n, m \in \Nat$. The Choi-Jamiolkowski (or CJ in short) operator of $\channel$ is given by the following matrix $\CJ\left( \channel \right) \in \Lin\left( \Hilb_{0} \otimes \Hilb_{1} \right)$:
    $$
    \CJ\left( \channel \right)
    :=
    \sum_{x, y \in \{ 0, 1 \}^{n} }
    \ket{x}\bra{y} 
    \otimes
    \channel\left( \ket{x}\bra{y}  \right)
    \enspace .
    $$
\end{definition}

We will also use the inverse CJ isomorphism, which is defined as follows.

\begin{definition} [Inverse of Choi-Jamiolkowski transformation] \label{definition:inverse_cj}
    Let $M \in \Lin\left( \Hilb_{0} \otimes \Hilb_{1} \right)$ a linear operator.
    The inverse CJ transformation of the tuple $\left( M, \Hilb_{0}, \Hilb_{1} \right)$ is defined as the linear operator $\CJ^{-1}\left( M, \Hilb_{0}, \Hilb_{1} \right) \in \Lin\left( \Lin\left( \Hilb_{0} \right) , \Lin\left( \Hilb_{1} \right) \right)$ such that for every $X \in \Lin\left( \Hilb_{0} \right)$, 
    $$
    \left[ \CJ^{-1}\left( M, \Hilb_{0}, \Hilb_{1} \right) \right]\left( X \right)
    =
    \tr_{\Hilb_{0}}\left(
    \left( X \otimes I_{\Lin\left( \Hilb_{1} \right)} \right)
    \cdot
    M
    \right)
    \enspace .
    $$
\end{definition}

\begin{remark} [3 input parameters in inverse CJ isomorphism]
    In the above definition \ref{definition:inverse_cj} of the reverse CJ transformation $\CJ^{-1}$, note that unlike the forward transformation $\CJ$, we need to specify not only the operator $M$ but also the spaces $\Hilb_{0}$, $\Hilb_{1}$. The reason is that the space $\Hilb_{0} \otimes \Hilb_{1}$ can be decomposed in many different ways (i.e. for Hilbert spaces of different dimensions), and imply different operators by the inverse CJ transformation. This is different from the case of the forward transformation $\CJ$, where the input and output linear spaces are implicitly defined as part of the operator $\channel$.
\end{remark}













\subsection{Process Matrices}
Process matrices were first defined in \cite{oreshkov2012quantum}. We follow some of their notations and conventions from the existing literature.

\begin{definition} [Double ket notation] \label{definition:double_ket}
    Let $M \in \Lin\left( \Hilb_{0}, \Hilb_{1} \right)$ a matrix such that $\Hilb_{0} = \states\left( n \right)$, $\Hilb_{1} = \states\left( m \right)$ for some $n, m \in \Nat$. We define the following "double ket" vectors in $\bbC^{ 2^{n + m} }$:
    $$
    \Dket{M}
    :=
    \sum_{ x \in \{ 0, 1 \}^{n} }
    \left(
    \ket{x} \otimes M \cdot \ket{x}
    \right)
    \enspace ,
    $$
    $$
    \Dbra{M}
    :=
    \Dket{M}^{\dagger}
    :=
    \sum_{ x \in \{ 0, 1 \}^{n} }
    \left(
    \bra{x} \otimes \bra{x} \cdot M^{\dagger}
    \right)
    \enspace .
    $$
\end{definition}

We next define the indefinite operator of a matrix $W$, which is used later to define what is a process matrix.

\begin{definition} [Indefinite Operator] \label{definition:indefinite_operator}
    Let $W \in \Lin\left( \Hilb_{ A_{I} } \otimes \Hilb_{ P } \otimes \Hilb_{A_{O}} \otimes \Hilb_{ F } \right)$ for Hilbert spaces $\Hilb_{ A_{I} }$, $\Hilb_{ P }$, $\Hilb_{A_{O}}$, $\Hilb_{ F }$ such that $\Hilb_{ A_{I} } = \Hilb_{ A_{O} } = \states\left( n \right)$. The indefinite operator of $W$ with respect to the Hilbert spaces $\Hilb_{ A_{I} }$, $\Hilb_{ A_{O} }$ is the operator $G_{W, A_{I}, A_{O}} \in \Lin\left( \Hilb_{ P } \otimes \Hilb_{ F } \right)$ such that
    $$
    G_{ W, A_{I}, A_{O} }
    :=
    \tr_{ A_{I}, A_{O} }
    \left(
    W
    \cdot
    \ket{ A_{ I }, P, F }
    \bra{ A_{ I }, P, F }
    \right)
    \enspace ,
    $$
    where 
    $$
    \ket{ A_{ I }, P, F }
    :=
    \sum_{ x \in \{ 0, 1 \}^{n} }
    \ket{x} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \ket{x} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \enspace ,
    $$
    $$
    \bra{ A_{ I }, P, F }
    :=
    \sum_{ y \in \{ 0, 1 \}^{n} }
    \bra{y} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \bra{y} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \enspace .
    $$
\end{definition}

We define process matrices as follows. 

\begin{definition} [Process Matrix] \label{definition:process_matrix}
    Let $W \in \Lin\left( \Hilb_{ A_{I} } \otimes \Hilb_{ P } \otimes \Hilb_{A_{O}} \otimes \Hilb_{ F } \right)$ for Hilbert spaces $\Hilb_{ A_{I} }$, $\Hilb_{ P }$, $\Hilb_{A_{O}}$, $\Hilb_{ F }$ such that $\Hilb_{ A_{I} } = \Hilb_{ A_{O} } = \states\left( n \right)$. Define the following linear operator $\pmo\left( W, \Hilb_{ A_{I} }, \Hilb_{ A_{O} } \right) \in \Lin\left( \Lin\left( \Hilb_{ P } \right), \Lin\left( \Hilb_{ F } \right) \right)$ as
    $$
    \pmo\left( W, \Hilb_{ A_{I} }, \Hilb_{ A_{O} } \right) 
    :=
    \CJ^{-1}\left( G_{ W, \Hilb_{ A_{I} }, \Hilb_{ A_{O} } }, \; \Hilb_{ P }, \Hilb_{ F } \right)
    \enspace ,
    $$
    where $G_{ W, \Hilb_{ A_{I} }, \Hilb_{ A_{O} } }$ is the indefinite operator of $W$ with respect to the spaces $\Hilb_{ A_{I} }$, $\Hilb_{ A_{O} }$, as in Definition \ref{definition:indefinite_operator}, and $\CJ^{-1}$ is the inverse CJ transformation, as in Definition \ref{definition:inverse_cj}.
    
    We say that $W$ is a process matrix with respect to $\Hilb_{ A_{I} }$, $\Hilb_{ A_{O} }$ if $\pmo\left( W, \Hilb_{ A_{I} }, \Hilb_{ A_{O} } \right) $ is not only a linear operator, but a quantum channel from $\Lin\left( \Hilb_{ P } \right)$ to $\Lin\left( \Hilb_{ F } \right)$, i.e. it is completely positive and trace-preserving.
\end{definition}

\begin{remark} [Intuition behind the operator $\pmo$]
    The name $\pmo$ is meant for a Process Matrix Operator. The idea behind the operator $\pmo$ is that it tries to take a general linear map, and map it to not just any linear transformation, but a quantum channel. What defines a process matrix $W$ is the fact that the mapping is "successful" for $W$ and spaces $\Hilb_{A_{I}}$, $\Hilb_{A_{O}}$, and the $\pmo$ is a quantum channel.
\end{remark}

\subsection{Computational Complexity of Process Matrices}
In the above subsections, all definitions were information theoretical. The work \cite{araujo2017quantum} was the first to consider the complexity theoretical aspect of process matrices. In this subsection we add our own notions of computation and computational complexity of process matrices, using previous work and adding new notions in some places.

\begin{definition} [Quantum channel of a quantum circuit]
    For $n, m \in \Nat$, let $C$ a quantum circuit from $n$ to $m$ qubits (as in defined in Section \ref{section:preliminaries}).

    The quantum channel of $C$, denoted $\channel_{C} \in \Lin\left( \Lin\left( \states\left( n \right) \right), \Lin\left( \states\left( m \right) \right) \right)$ is defined such that its action on a matrix $M \in \Lin\left( \states\left( n \right) \right)$ is the same as the action of $C$ on an $n$-qubit mixed quantum state.
\end{definition}

\paragraph{Quantum Polynomial-time Circuits as Process Matrix Generators.}
We next define a new notion, called Process Matrix Generators (PMG). Intuitively, PMGs are quantum circuits such that if we take their CJ representations, we get a process matrix. We care about polynomial-time PMGs, as they play a central role in the definition of polynomial-time process matrix computation. In particular, when we later define the complexity class $\BQPlctc$ from previous work (and a new class $\BQPuctc$), we will do so using the new definition, and ask that all process matrix transformations allowed in $\BQPlctc$ are only by quantum polynomial-time PMGs.

\begin{definition} [Process Matrix Generator] \label{definition:process_matrix_generator}
    Let $n \in \Nat$, let $r, \ell \in \left( \Nat \cup \{ 0 \} \right)$ and let $C$ an $(n + r)$-to-$(n + \ell)$ quantum circuit. Consider the quantum channel $\channel_{C} \in \Lin\left( \Lin\left( \Hilb_{ A_{I} } \otimes \Hilb_{P} \right), \Lin\left( \Hilb_{A_{O}} \otimes \Hilb_{F} \right) \right)$ of the circuit $C$, such that $\Hilb_{ A_{I} } = \states\left( n \right)$, $\Hilb_{ P } = \states\left( r \right)$, $\Hilb_{ A_{O} } = \states\left( n \right)$, $\Hilb_{ F } = \states\left( \ell \right)$.
    
    Define the following operator $\pmo_{\left( n, C \right)} \in \Lin\left( \Lin\left( \Hilb_{P} \right), \Lin\left( \Hilb_{F} \right) \right)$:
    $$
    \pmo_{\left( n, C \right)}
    :=
    \pmo\left( \CJ\left( \channel_{C} \right), \Hilb_{ A_{I} }, \Hilb_{ A_{O} } \right)
    \enspace ,
    $$
    where $\pmo\left( \CJ\left( \channel_{C} \right), \Hilb_{ A_{I} }, \Hilb_{ A_{O} } \right)$ is as per Definition \ref{definition:process_matrix}.
    If $\pmo_{\left( n, C \right)}$ is a valid quantum channel from $\Lin\left( \Hilb_{P} \right)$ to $\Lin\left( \Hilb_{F} \right)$ (i.e., it is not only a linear operator, but also completely positive and trace-preserving), we say that the tuple $\left( n, C \right)$ is a Process Matrix Generator (or PMG), and denote by $\pmo_{\left( n, C \right)}$ the Process Matrix Channel of the tuple.
\end{definition}

\paragraph{Simplified formula for evaluating process matrix generators.}
The following Lemma gives a quicker way to asses whether the tuple $\left( n, C \right)$ is a PMG or not.
Specifically, assume that $C$ is an isometry on quantum states, that given an $(n + r)$-qubit pure state $\ket{\psi} \in \states\left( n + r \right)$, concatenates $k$ ancillary qubits and executes a unitary $U$ on $n + r + k$ qubits. The below Lemma is a generalization of the simplifying Equation (21) from \cite{araujo2017quantum}.

\begin{lemma} [Simplified PM Formula for Isometries] \label{lemma:simplified_isometry_pm}
    Let $n, r \in \Nat$, $k \in \Nat \cup \{ 0 \}$, and let $U \in \bbC^{ \left( 2^{ n + r + k } \right) \times \left( 2^{ n + r + k } \right) }$ a unitary matrix.
    Let $\channel_{\left( U, k \right)}$ the quantum channel of the $k$-isometry of $U$, that is, for an input $(n + r)$-qubit mixed state $\rho$ the channel adds an ancilla of $k$ qubits and executes $U$, that is,
    $$
    \channel_{\left( U, k \right)}\left( \rho \right)
    :=
    U \cdot \left( \rho \otimes \ket{ 0^{k} }\bra{ 0^{k} } \right) \cdot U^{\dagger}
    \enspace .
    $$
    Denote the Hilbert spaces of the channel,
    $$
    \channel_{\left( U, k \right)} \in \Lin\left( \Lin\left( \Hilb_{ A_{I} } \otimes \Hilb_{P} \right), \Lin\left( \Hilb_{A_{O}} \otimes \Hilb_{F} \right) \right) \enspace ,
    $$
    such that $\Hilb_{ A_{I} } = \states\left( n \right)$, $\Hilb_{ P } = \states\left( r \right)$, $\Hilb_{ A_{O} } = \states\left( n \right)$, $\Hilb_{ F } = \states\left( r + k \right)$. 

    Let $W := \CJ\left( \channel_{\left( U, k \right)} \right)$ and let $G_{W, A_{I}, A_{O}}$ the indefinite operator of $W$ with respect to $\Hilb_{ A_{I} }$, $\Hilb_{ A_{O} }$ (as in Definition \ref{definition:indefinite_operator}). Then we have the equality
    $$
    G_{W, A_{I}, A_{O}}
    =
    \CJ\left( \channel_{ \left( U_{G}, k \right) } \right)
    \enspace ,
    $$
    for the matrix $U_{G} \in \bbC^{ 2^{r + k} \times 2^{r + k} }$ such that
    $$
    U_{G}
    =
    \tr_{ \Hilb_{ A_{I} } }\left( U \right) \enspace .
    $$
    That is, $U_{G}$ is the matrix derived by tracing out the Hilbert space of the leftmost $n$ qubits from the unitary matrix $U$ itself, and the linear operator $\channel_{ \left( U_{G}, k \right) }$ is such that for an input matrix $\sigma \in \bbC^{ 2^{r} \times 2^{r} }$, outputs:
    $$
    \channel_{ \left( U_{G}, k \right) }\left( \sigma \right)
    =
    U_{G} \cdot \left( \sigma \otimes \ket{ 0^{k} }\bra{ 0^{k} } \right) \cdot U^{\dagger}_{G}
    \enspace .
    $$

    In particular, if $U_{G}$ is a matrix such that $\channel_{ \left( U_{G}, k \right) }$ is a valid quantum channel, then
    \begin{itemize}
        \item
        $W := \CJ\left( \channel_{\left( U, k \right)} \right)$ is a process matrix with respect to $\Hilb_{0}$, $\Hilb_{1}$.

        \item 
        For any quantum circuit $C$ that implements the original channel $\channel_{ \left( U, k \right) }$, we have that $\left( n, C \right)$ is a PMG with the valid quantum channel PMO $\channel_{ \left( U_{G}, k \right) }$ (as in Definition \ref{definition:process_matrix_generator}).
    \end{itemize}
\end{lemma}

\begin{proof}
     Note that there is an isometry $V \in \bbC^{ 2^{n + r + k} \times 2^{n + r} }$ that for any $x \in \{ 0, 1 \}^{n + r}$, $V\cdot \ket{x} = U \cdot \left( \ket{x} \otimes \ket{ 0^{k} } \right)$. It follows that the action of the channel $\channel_{\left( U, k \right)}$ for an input $(n + r)$-qubit mixed state $\rho$ is $V \cdot \rho \cdot V^{\dagger}$. This implies that $W := \CJ\left( \channel_{\left( U, k \right)} \right) = \Dket{V}\Dbra{V}$.
    
    By Definition \ref{definition:indefinite_operator}, the indefinite operator $G_{W, A_{ I }, A_{ O }}$ of $W = \Dket{V}\Dbra{V}$ with respect to the Hilbert spaces $\Hilb_{ A_{I} }$, $\Hilb_{ A_{O} }$ is
    $$
    G_{ W, A_{I}, A_{O} }
    :=
    \tr_{ A_{I}, A_{O} }
    \left(
    \Dket{V}\Dbra{V}
    \cdot
    \ket{ A_{I}, P, F } \bra{ A_{I}, P, F }
    \right)
    \enspace .
    $$

    Let us break down the expression inside the partial trace. By Definition \ref{definition:double_ket}, 
    $$
    \Dket{V}\Dbra{V}
    :=
    \sum_{ x \in \{ 0, 1 \}^{n + r} } \left( \ket{x} \otimes V \cdot \ket{x} \right)
    \sum_{ y \in \{ 0, 1 \}^{n + r} } \left( \bra{y} \otimes \bra{y} \cdot V^{\dagger} \right)
    \enspace .
    $$
    From Definition \ref{definition:indefinite_operator} we also have
    $$
    \ket{ A_{ I }, P, F }
    :=
    \sum_{ u \in \{ 0, 1 \}^{n} }
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \enspace ,
    $$
    $$
    \bra{ A_{ I }, P, F }
    :=
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \enspace .
    $$

    By the linearity of trace we get
    $$
    G_{ W, A_{I}, A_{O} }
    :=
    \tr_{ A_{I}, A_{O} }
    \left(
    \Dket{V}\Dbra{V}
    \cdot
    \ket{ A_{I}, P, F } \bra{ A_{I}, P, F }
    \right)
    $$
    $$
    =
    \sum_{ x, y \in \{ 0, 1 \}^{n + r}, u, v \in \{ 0, 1 \}^{n} }
    \tr_{ A_{I}, A_{O} }
    \bigg(
    \left( \ket{x} \otimes V \cdot \ket{x} \right)
    \left( \bra{y} \otimes \bra{y} \cdot V^{\dagger} \right)
    $$
    $$
    \hspace{4cm}
    \cdot \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \bigg)
    \enspace .
    $$

    Next, by the cyclic property of trace, the above equals 
    $$
    =
    \sum_{ x, y \in \{ 0, 1 \}^{n + r}, u, v \in \{ 0, 1 \}^{n} }
    \tr_{ A_{I}, A_{O} }
    \bigg(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \left( \ket{x} \otimes V \cdot \ket{x} \right)
    $$
    $$
    \hspace{4cm}
    \cdot
    \left( \bra{y} \otimes \bra{y} \cdot V^{\dagger} \right)
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \bigg)
    $$
    $$
    =
    \sum_{ a, b \in \{ 0, 1 \}^{n}, i, j \in \{ 0, 1 \}^{r}, u, v \in \{ 0, 1 \}^{n} }
    \tr_{ A_{I}, A_{O} }
    \bigg(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \left( \ket{a, i} \otimes V \cdot \ket{a, i} \right)
    $$
    $$
    \hspace{4cm}
    \cdot
    \left( \bra{b, j} \otimes \bra{b, j} \cdot V^{\dagger} \right)
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{P} \right) } \otimes \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \bigg)
    \enspace .
    $$

    By considering the result of inner products for the expression inside the trace, we get that the summand for $i, j, u, v$ is
    $$
    \left(
    \ket{i}
    \otimes
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    \cdot
    \left(
    \bra{j}
    \otimes
    \bra{u, j} \cdot V^{\dagger}
    \cdot
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \right)
    \enspace .
    $$
    Observe that at this point of the calculation, for the expression inside the trace (for each set of indices $i, j, u, v$), the systems $\Hilb_{ A_{I} }$, $\Hilb_{ A_{O} }$ are not longer present. In particular, the trace can be removed from the previous sum, and we get that $G_{ W, A_{I}, A_{O} }$ equals:
    $$
    =
    \sum_{ i, j \in \{ 0, 1 \}^{r}, u, v \in \{ 0, 1 \}^{n} }
    \left(
    \ket{i}
    \otimes
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    \cdot
    \left(
    \bra{j}
    \otimes
    \bra{u, j} \cdot V^{\dagger}
    \cdot
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \right)
    \enspace .
    $$

    We next consider, for every \emph{fixed} pair $i, j \in \{ 0, 1 \}^{r}$, the sum over all \emph{different} $u, v \in \{ 0, 1 \}^{n}$:
    $$
    \sum_{ v, u \in \{ 0, 1 \}^{n} }
    \left(
    \ket{i}
    \otimes
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    \right)
    \cdot
    \left(
    \bra{j}
    \otimes
    \left(
    \bra{u, j} \cdot V^{\dagger}
    \cdot
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \right)
    \right)
    \enspace .
    $$
    Observe that in the above we have a sum, over $u, v \in \{ 0, 1 \}^{n}$, where every summand is a product between two elements. However, the left element in each product only depends on $v$, and every element on the right only depends on $u$. It follows that the above can be written in the form:
    $$
    =
    \left(
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \ket{i}
    \otimes
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    \right)
    \cdot
    \left(
    \sum_{ u \in \{ 0, 1 \}^{n} }
    \bra{j}
    \otimes
    \left(
    \bra{u, j} \cdot V^{\dagger}
    \cdot
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \right)
    \right)
    \enspace .
    $$
    Let us analyze the left multiplicand, and the analysis of the right multiplicand will be symmetric:
    $$
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \ket{i}
    \otimes
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    $$
    $$
    =
    \ket{i}
    \otimes
    \left(
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    \right)
    \enspace .
    $$

    Recall that $\forall (v, i) \in \{ 0, 1 \}^{n + r}$ we have $V\cdot \ket{v, i} = U \cdot \left( \ket{v, i} \otimes \ket{0^k} \right)$. Now, observe that for every $i \in \{ 0, 1 \}^{r}$ we have 
    $$
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    $$
    $$
    =
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    U \cdot \left( \ket{v, i} \otimes \ket{0^k} \right)
    \right)
    $$
    $$
    =
    \left( \tr_{ A_{I} }\left( U \right) \right)
    \cdot
    \left( \ket{i} \otimes \ket{0^k} \right)
    \enspace .
    $$
    To conclude, by denoting $U_{G} := \tr_{ A_{I} }\left( U \right) \in \bbC^{ 2^{ r + k } \times 2^{ r + k } }$, for every $i \in \{ 0, 1 \}^{r}$ we have the equality :
    $$
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \ket{i}
    \otimes
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    =
    \ket{i}
    \otimes
    U_{G}
    \cdot
    \left( \ket{i} \otimes \ket{0^k} \right)
    \enspace .
    $$
    In a similar manner, by a symmetric calculation we have the equality for every $j \in \{ 0, 1 \}^{r}$:
    $$
    \sum_{ u \in \{ 0, 1 \}^{n} }
    \bra{j}
    \otimes
    \left(
    \bra{u, j} \cdot V^{\dagger}
    \cdot
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \right)
    =
    \bra{j}
    \otimes
    \left( \bra{j} \otimes \bra{0^k} \right)
    \cdot
    U^{\dagger}_{G}
    \enspace .
    $$

    Let us summarize the results and conclude the proof. We saw that 
    $$
    G_{ W, A_{I}, A_{O} }
    =
    \sum_{ i, j, \in \{ 0, 1 \}^{r} }
    \left(
    \sum_{ v \in \{ 0, 1 \}^{n} }
    \ket{i}
    \otimes
    \left(
    \left(
    \bra{v} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \cdot 
    V \cdot \ket{v,i}
    \right)
    \right)
    $$
    $$
    \hspace{6cm}
    \cdot
    \left(
    \sum_{ u \in \{ 0, 1 \}^{n} }
    \bra{j}
    \otimes
    \left(
    \bra{u, j} \cdot V^{\dagger}
    \cdot
    \left(
    \ket{u} \otimes I_{ \Lin\left( \Hilb_{F} \right) }
    \right)
    \right)
    \right)
    \enspace ,
    $$
    and by our analysis of the multiplicands in the sum, the above equals
    $$
    =
    \sum_{ i, j, \in \{ 0, 1 \}^{r} }
    \left(
    \ket{i}
    \otimes
    U_{G}
    \cdot
    \left( \ket{i} \otimes \ket{0^k} \right)
    \right)
    \left(
    \bra{j}
    \otimes
    \left( \bra{j} \otimes \bra{0^k} \right)
    \cdot
    U^{\dagger}_{G}
    \right)
    $$
    $$
    =
    \sum_{ i, j, \in \{ 0, 1 \}^{r} }
    \ket{i}\bra{j}
    \otimes
    \left(
    U_{G}
    \cdot
    \left( \ket{i} \otimes \ket{0^k} \right)
    \right)
    \left(
    \left( \bra{j} \otimes \bra{0^k} \right)
    \cdot
    U^{\dagger}_{G}
    \right)
    $$
    $$
    =
    \sum_{ i, j, \in \{ 0, 1 \}^{r} }
    \ket{i}\bra{j}
    \otimes
    \left(
    U_{G}
    \cdot
    \left( \ket{i}\bra{j} \otimes \ket{0^k}\bra{0^k} \right)
    \cdot
    U^{\dagger}_{G}
    \right)
    \enspace .
    $$
    It is left to observe that by the Definition \ref{definition:cj_isomorphism}, the last expression is exactly the CJ transformation of the linear operator $\channel_{ \left( U_{G}, k \right) }$ defined in the statement of Lemma \ref{lemma:simplified_isometry_pm}.
\end{proof}





\subsection{Process Matrices and Closed Timelike Curves - Complexity Classes}
In this Section we define the complexity classes for polynomial-time process matrix computation. We first define $\BQPlctc$, first introduced in \cite{araujo2017quantum}, for polynomial-time arbitrary process matrices (which is equivalent to quantum polynomial-time computation with access to linear post-selection CTCs). We then define $\BQPuctc$, which is new to this work, for polynomial-time purifiable process matrices (which is equivalent to quantum polynomial-time computation with access to unitary post-selection CTCs). Finally, we note that in our version of $\BQPlctc$ we make some changes to the definition in previous work, and for completeness, we make a formal comparison between the two versions of the definition.

In both definitions of $\BQPlctc$ and $\BQPuctc$ below we use the definition of process matrix generators (Definition \ref{definition:process_matrix_generator}), which is cumbersome to evaluate. We note the simplifying Lemma \ref{lemma:simplified_isometry_pm} for easier evaluation of whether a pair $\left( m, C \right)$ is a PMG or not, and if so, what is the channel it induces.

\subsubsection{Quantum Computation with access to Linear Post-Selection CTCs} \label{subsubsection:computation_with_linear_CTCs}
In order to define quantum computation with access to linear CTCs, we first define the operation for generating access to linear CTCs.
%A linear CTC generator is function $A$, that for the queries to $\GenLCTC$ that are successful, necessarily generates access to the correct channel $\pmo_{\left( m, C \right)}$, and for the incorrect queries, generates access to an arbitrary channel $\channel$.

\begin{definition} [Linear Closed Timelike Curve Generator] \label{definition:linear_ctc_generator}
    Let $A$ a function with input set of pairs $\left( m, C \right)$ where $m \in \Nat$ and $C$ a quantum circuit from $m + r$ to $m + \ell$ qubits for some $r, \ell \in \Nat$, and output set of $r$-to-$\ell$ qubit quantum channels. We say that $A$ is a linear CTC generator if for every valid input $\left( m, C \right)$, if the pair is a PMG (as in Definition \ref{definition:process_matrix_generator}) then $A$ outputs the channel $\pmo_{\left( m, C \right)}$ (and if the input is not a PMG, the output channel of $A$ can be arbitrary).
\end{definition}

We can now define the complexity class $\BQPlctc$.

\begin{definition} [The Complexity Class $\BQPlctc$] \label{definition:BQPlctc}
    The complexity class $\BQPlctc$ is the set of promise problems $\prod := \left( \YES , \NO \right)$ that are solvable by a quantum polynomial-time algorithm with access to linear post-selection CTCs. Formally, such that there exists a quantum polynomial-time Turing Machine $M$ such that for every linear CTC generator $A$ (as per Definition \ref{definition:linear_ctc_generator}), for every $x \in \YES$, $M^{A}(x) = 1$ with probability at least $p(x)$, and for every $x \in \NO$, $M^{A}(x) = 0$ with probability at least $p(x)$, such that
    \begin{itemize}
        \item
        $$
        \forall x \in \left( \YES \cup \NO \right) : p(x) \geq 1 - 2^{-|x|} \enspace ,
        $$

        \item 
        $M^{A}$ is the machine $M$ with oracle access to $A$ and the channels that it outputs, and
        
        \item 
        Every query $\left( m, C \right)$ to $A$ (and the channel it produces) costs $\Theta\left( |C| \right)$ time.
    \end{itemize}
\end{definition}



\paragraph{Comparison to Previous Definition.}
We mention two changes made from the definition of $\BQPlctc$ in \cite{araujo2017quantum} to our version, and remark in the end (Remark \ref{remark:USAT_solvable_by_zero_error}) why this does not influence our core algorithm. For the comparison, we denote the computational model of $\BQPlctc$ as defined in the previous work (Definition 1 in \cite{araujo2017quantum}) with $\BQPlctc^{ZE}$ (stands for "zero-error linear CTC generation" -- it will be clear in a bit why we choose this name). $\BQPlctc^{ZE}$ is defined as follows:
There is a quantum polynomial-time Turing Machine $M$ that first gets $n \in \Nat$, and constructs a single query $\left( m, C \right)$ to $A$, the CTC generator. The circuit $C$ has $\geq m + n$ input and output qubits, where the $n$ input bits are designated for an input $x \in \{ 0, 1 \}^{n}$. The machine $M$ then gets a specific $x \in \{ 0, 1 \}^{n}$ and needs to decide it correctly with probability $1 - 2^{-|x|}$ (the exact definition in the previous work says the probability needs to be at least $\frac{2}{3}$, but it is immediately equivalent to $1 - 2^{-|x|}$ by known techniques), given access to the channel generated by $A$. 
There is one more detail to the previous definition, which creates a constraint: The machine $M$ is such that the query $\left( m, C \right)$ to $A$ has to always be successful, that is, the pair $\left( m, C \right)$ is always a PMG (as in Definition \ref{definition:process_matrix_generator}). Note that given a pair $\left( m, C \right)$ it seems hard to decide whether it is a PMG or not in quantum polynomial time, thus this constraint seem to weaken the model.

We think of the abovementioned property as a zero-error version for querying the CTC generator, and hence our notation of $\BQPlctc^{ZE}$ for the definition from previous work. To more clearly see the difference between the previous $\BQPlctc^{ZE}$ and our definition of $\BQPlctc$, let us start with the above model (which is $\BQPlctc^{ZE}$, the definition of $\BQPlctc$ from previous work) and make a sequence of changes until we get to a model as close to ours (i.e., Definition \ref{definition:BQPlctc}) as possible.
\begin{enumerate}
    \item \label{equivalent_models_toprevious:step_1}
    The first change that still keeps the model equivalent: In the following version of the model, the machine $M^{(1)}$ can generate the query $\left( m, C_{x} \right)$ as a function of the input itself $x$ and not as a function of only $n := |x|$. The machine $M^{(1)}$ still needs the CTC generation query $\left( m, C_{x} \right)$ for $A$ to always be correct, that is, a valid PMG. Note that this equivalent model is already sufficient to solve $\USAT$ (see the below Remark \ref{remark:USAT_solvable_by_zero_error}).
    
    This model is equivalent to the previous one: In the new model, the machine $M^{(1)}$ always computes a circuit $x \rightarrow C_{x}$, and by standard techniques in complexity theory (specifically, techniques showing how a Boolean circuit simulates the execution of a Turing machine on a fixed input size $n$) we have a circuit $C^{(1)}$ that computes $x \rightarrow C_{x}$ for all $x$ s.t. $|x| = n$. The previous model can now easily simulate the seemingly stronger, new one: When the machine $M$ (from the previous model) gets $n$, it computes a circuit $C$ where as part of the execution of $C$, the circuit $C^{(1)}$ is inside, computing $C_{x}$ given $x \in \{ 0, 1 \}^{n}$. The circuit $C$ then executes $C_{x}$ on the input $\left( y \in \{ 0, 1 \}^{m}, x \in \{ 0, 1 \}^{n} ,z \in \{ 0, 1 \}^{\ell} \right)$, and when we trace out from $C$, we trace out the input part of $y$. Eventually, the CTC generation query that $M$ produces is $\left( m, C \right)$.
    
    \item \label{equivalent_models_toprevious:step_2}
    The second change that still keeps the model equivalent: $M^{(2)}$ gets $x$ and makes many queries $\left( m_{1}, C_{1} \right)$, $\left( m_{2}, C_{2} \right)$, $\cdots$, $\left( m_{k}, C_{k} \right)$ to $A$ (rather than a single one $\left( m, C \right)$). After the queries to $A$ are computed by $M^{(2)}(x)$, only then $A$ computes the $k$ channels, and $M^{(2)}$ needs to decide for $x$. This is equivalent to the previous model in Step \ref{equivalent_models_toprevious:step_1}, because we can think of all $k$ generation queries  unified into one big circuit that executes all $k$ circuits in parallel. Since all $k$ queries are PMGs, it can be easily verified that the circuit that parallels all $k$ circuits will also induce a PMG.

    \item \label{equivalent_models_toprevious:step_3}
    \paragraph{First non-equivalent change to previous definition -- non-zero probability to err in CTC queries to $A$.}
    This is the first change that we make to the model which we do not know it to be equivalent to the previous step. Specifically, in the previous step \ref{equivalent_models_toprevious:step_2} we have a quantum polynomial-time Turing machine $M^{(2)}$ that gets $x$, then generates $k$ queries to $A$, then gets access to the $k$ channels generated by $A$, and then correctly (with high probability) decides the inclusion of $x$ in $\YES$ or $\NO$. The next change is to let some of the $k$ CTC generation queries be incorrect, and whenever one of them is incorrect, the CTC generator $A$ may give access to an arbitrary channel $\channel$ (as described in \ref{definition:linear_ctc_generator}). This is the model that we need in order to solve $\SAT$ (see the below Remark \ref{remark:USAT_solvable_by_zero_error}).

    \item \label{equivalent_models_toprevious:step_4}
    \paragraph{Second non-equivalent change to previous definition -- adaptive queries to CTC generator $A$.}
    The last change we make is only for completeness of the model, and we do not use it in our solution for $\SAT$. Specifically, there is no reason to think that $M$ is non-adaptive when it queries the CTC generator $A$: If $M$ can send a query $\left( m, C \right)$ to $A$, there is no reason to restrict the next query $\left( m', C' \right)$ from being computed after access to the channel $\channel$ that $A$ generated for the first query $\left( m, C \right)$. In this model, $M$ gets $x$, can query $A$ throughout its execution, and specifically, can make queries to $A$ that are computed \emph{after} getting access to some of the channels that $A$ previously generated.
\end{enumerate}

Note that the above step \ref{equivalent_models_toprevious:step_4} is exactly our Definition \ref{definition:BQPlctc} for the class $\BQPlctc$. So, conceptually, the two changes from the previous definition is (1) the ability to have a non-zero probability for error in CTC queries to the CTC generator $A$, and (2) the ability to compute adaptive queries to the CTC generator $A$.

\begin{remark} [Solving $\USAT$ with the Zero-error Model] \label{remark:USAT_solvable_by_zero_error}
    It is worth noting that even if we stay with the previous, zero-error model $\BQPlctc^{ZE}$ of \cite{araujo2017quantum}, our algorithm for $\USAT$ (described formally in Lemma \ref{lemma:USAT_algorithm}) still works (and using only pure process matrices).
    
    To see this, consider the equivalent definition to $\BQPlctc^{ZE}$ from Step \ref{equivalent_models_toprevious:step_1} above, where $M$ is allowed to make a single CTC generation query, that depends on the input $x$, and the query needs to be correct for every valid input $x$. $\USAT$ is a search problem where the set of all possible inputs are all CNF formulas $\varphi$ that have exactly one satisfying assignment. Our algorithm works with a single query to the unitary CTC generator, for every uniquely satisfiable CNF formula $\varphi$, and the CTC generation always works, thus falling into the zero-error model.
    We do need, however, the ability to err in order to solve $\SAT$. Specifically, for solving $\SAT$ we need the model described in Step \ref{equivalent_models_toprevious:step_3} above. This is due to the error probability of the Valiant-Vazirani (VV) reduction \cite{valiant1985np}: While the VV algorithm has a zero-error for inputs $\varphi$ that are not satisfiable, for inputs that are satisfiable, the resulting $\varphi^{*}$ of the VV algorithm has a unique satisfying assignment only with probability $\Omega\left( \frac{1}{n} \right)$. Since our zero-error algorithm for $\USAT$ works only if the input is valid (i.e., if $\varphi^{*}$ is uniquely satisfiable), this will mean that some of our queries to the CTC generation algorithm would be erroneous, but with probability exponentially close to $1$, at least one of the queries will be valid (as we repeat the VV algorithm $n^2$ times). 
\end{remark}










\subsubsection{Quantum Computation with access to Unitary Post-Selection CTCs}
We define the class $\BQPuctc$, a natural restriction of $\BQPlctc$ which captures quantum computation with access to unitary CTCs. We start with recalling the standard definition of unitary quantum channels. 

\begin{definition} [Unitary Quantum channel] \label{definition:unitary_quantum_channel}
    Let $n \in \Nat$ and let $\channel$ an $n$-to-$n$ qubit quantum channel, as per Definition \ref{definition:quantum_channel}. We further say that $\channel$ is a unitary quantum channel if there exists a unitary matrix $U_{\channel} \in \bbC^{2^n \times 2^n}$ such that for every $n$-qubit pure state $\ket{\psi}$ we have the equality:
    $$
    \channel\left( \ket{\psi}\bra{\psi} \right)
    =
    U_{\channel} \cdot \ket{\psi}\bra{\psi} \cdot U_{\channel}^{\dagger}
    \enspace .
    $$
\end{definition}

The work \cite{araujo2017purification} introduced and defined the notion of pure process matrices. With accordance to their Definition 1 (and their Theorem 2) for a pure process matrix $W$, we define \emph{pure} process matrix generators, a subclass of process matrix generators.

\begin{definition} [Pure Process Matrix Generator] \label{definition:pure_process_matrix_generator}
    Let $n \in \Nat$, let $r \in \Nat$ and let $C$ an $(n + r)$-to-$(n + r)$ quantum circuit. Denote by $\channel_{C}$ the ($(n + r)$-to-$(n + r)$ qubits) quantum channel of the circuit $C$. We say that $\left( n, C \right)$ is a Pure Process Matrix Generator (or pure PMG for short) if all of the below holds:
    \begin{itemize}
        \item
        The pair $\left( n, C \right)$ is a PMG, as per Definition \ref{definition:process_matrix_generator}. Denote by $\pmo_{\left( n, C \right)}$ the process matrix channel.

        \item 
        The original channel $\channel_{C}$ is a unitary quantum channel, as per Definition \ref{definition:unitary_quantum_channel}.

        \item 
        The generated channel $\pmo_{\left( n, C \right)}$ is also a unitary quantum channel, as per Definition \ref{definition:unitary_quantum_channel}.
    \end{itemize}
\end{definition}

Now, given the definition of pure PMGs, we can define the operation for generating access to unitary CTCs.

\begin{definition} [Unitary Closed Timelike Curve Generator] \label{definition:unitary_ctc_generator}
    Let $A$ a function with input set of pairs $\left( m, C \right)$ where $m \in \Nat$ and $C$ a quantum circuit from $m + r$ to $m + r$ qubits for some $r \in \Nat$, and output set of $r$-to-$r$ qubit quantum channels. We say that $A$ is a unitary CTC generator if for every valid input $\left( m, C \right)$, if the pair is a pure PMG (as in Definition \ref{definition:pure_process_matrix_generator}) then $A$ outputs the channel $\pmo_{\left( m, C \right)}$ (and if the input is not a pure PMG, the output channel of $A$ can be any $r$-to-$r$ quantum channel).
\end{definition}

We can now define the complexity class $\BQPuctc$.

\begin{definition} [The Complexity Class $\BQPuctc$] \label{definition:BQPuctc}
    The complexity class $\BQPuctc$ is the set of promise problems $\prod := \left( \YES , \NO \right)$ that are solvable by a quantum polynomial-time algorithm with access to unitary post-selection CTCs. Formally, such that there exists a quantum polynomial-time Turing Machine $M$ such that for every unitary CTC generator $A$ (as per Definition \ref{definition:unitary_ctc_generator}), for every $x \in \YES$, $M^{A}(x) = 1$ with probability at least $p(x)$, and for every $x \in \NO$, $M^{A}(x) = 0$ with probability at least $p(x)$, such that
    \begin{itemize}
        \item
        $$
        \forall x \in \left( \YES \cup \NO \right) : p(x) \geq 1 - 2^{-|x|} \enspace ,
        $$

        \item 
        $M^{A}$ is the machine $M$ with oracle access to $A$ and the channels that it outputs, and
        
        \item 
        Every query $\left( m, C \right)$ to $A$ (and the channel it produces) costs $\Theta\left( |C| \right)$ time.
    \end{itemize}
\end{definition}






































\section{$\SAT \in \BQPuctc$} \label{section:SAT_algorithm}
In this section we describe a $\BQPuctc$ algorithm for $\SAT$, which, due to the $\NP$-completeness of $\SAT$ (and the closeness of $\BQPuctc$ under Karp reductions), implies that $\NP \subseteq \BQPuctc$.

\begin{theorem}
    $\SAT \in \BQPuctc$.
\end{theorem}

\begin{proof}
    We describe a quantum polynomial-time Turing machine $M$ that has access to an arbitrary unitary CTC generator $A$ (as in Definition \ref{definition:unitary_ctc_generator}), and decides $\SAT$ with high probability. Let $\varphi$ an arbitrary CNF formula, and denote by $n$ the number of input Boolean variables to $\varphi$.

    Let $M_{\USAT}$ the algorithm from Lemma \ref{lemma:USAT_algorithm} and let $T_{VV}$ the algorithm from Theorem \ref{theorem:valiant_vazirani} and let $A$ any unitary CTC generator as in Definition \ref{definition:unitary_ctc_generator}. The machine $M$ executes the following procedure:
    \begin{enumerate}
        \item \label{SAT_algorithm:step_1}
        For $i = 1, 2, \cdots, n^2 - 1, n^2$:
        \begin{enumerate}
            \item
            Execute $\varphi^{*} \gets T_{VV}\left( \varphi \right)$.

            \item 
            Execute $z' \gets M_{\USAT}\left( \varphi^{*} \right)$.

            \item 
            If $\varphi^{*}\left( z' \right) = 1$, halt the loop and accept the original input $\varphi$. Otherwise, continue to the next iteration of $M$.
        \end{enumerate}

        \item 
        If none of the iterations in the previous loop caused to halt and accept, reject the original input $\varphi$.
    \end{enumerate}

    Assume that $\varphi \notin \SAT$, then by the correctness of $T_{VV}$, with probability $1$ over the randomness of $T_{VV}$, the CNF formula $\varphi^{*} \gets T_{VV}\left( \varphi \right)$ is not satisfiable, which means that there is no $z'$ such that $\varphi^{*}(z') = 1$, which means that $M$ will reject $\varphi$ with probability $1$.

    Assume that $\varphi \in \SAT$, then by the correctness of $T_{VV}$, with probability $\Omega\left( \frac{1}{n} \right)$ over the randomness of $T_{VV}$, the CNF formula $\varphi^{*} \gets T_{VV}\left( \varphi \right)$ is uniquely satisfiable. The machine $M$ executes $n^2$ iterations, and it follows that with probability $1 - 2^{-\Omega(n)}$, there exists at least one iteration in the loop from Step \ref{SAT_algorithm:step_1} where $\varphi^{*}$ is uniquely satisfiable -- denote the first such iteration with $j \in [n^2]$ and by $\varphi^{j}$ the CNF formula output of $T_{VV}$ in that iteration. By Lemma \ref{lemma:USAT_algorithm}, it follows that $M_{\USAT}\left( \varphi^{j} \right)$ outputs a string $z' \in \{ 0, 1 \}^{n}$ such that $\varphi^{j}\left( z' \right) = 1$. This will cause $M$ to accept the input $\varphi$ on the $j$-th iteration. Overall, if $\varphi \in \SAT$ then $M$ will accept $\varphi$ with probability $1 - 2^{-\Omega(n)}$.
\end{proof}





\begin{lemma} [Single-query unitary CTC algorithm for $\USAT$] \label{lemma:USAT_algorithm}
    There exists a classical deterministic polynomial-time algorithm $M_{\USAT}$ that for every CNF formula $\varphi^{*}$ which has exactly one satisfying assignment and every unitary CTC generator $A$ (as in Definition \ref{definition:unitary_ctc_generator}), makes one query $\left( m, C \right)$ to $A$ which is always a pure PMG (as in Definition \ref{definition:pure_process_matrix_generator}), gets access to the channel $\channel$ generated by $A$, then makes one query to $\channel$ and gets the unique satisfying assignment $z$ for $\varphi^{*}$.
\end{lemma}

\begin{proof}
    Let $n$ the number of input Boolean variables for $\varphi^{*}$ and let $z \in \{ 0, 1 \}^{n}$ the satisfying assignment for $\varphi^{*}$. $M_{\USAT}\left( \varphi^{*} \right)$ computes the $2n$-to-$2n$ quantum circuit $C_{\varphi^{*}}$ which for $x, y \in \{ 0, 1 \}^{n}$, executes as follows on input $\ket{x, y}$:
\begin{enumerate}
    \item
    Denote the first $n - 1$ bits of $x \in \{ 0, 1 \}^{n}$ with $x_{1, \cdots, n - 1}$. Check whether $\varphi^{*}\left( x_{1, \cdots, n - 1}, 0 \right) = 1$ or $\varphi^{*}\left( x_{1, \cdots, n - 1}, 1 \right) = 1$, where we are guaranteed that either both completions fail or exactly one succeeds. In case of success, we denote with $\left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) \in \{ 0, 1 \}^{n}$ the satisfying assignment and write $x \sim \varphi^{*}$. Importantly, observe that whether $x \sim \varphi^{*}$ or not can be computed efficiently (given $\varphi^{*}$) without looking on the last (rightmost) bit $x_n$ of $x$. 
    
    \item 
    If $x \sim \varphi^{*}$:
    \begin{enumerate}
        \item
        Let $y \in \{ 0, 1 \}^{n}$ the right $n$ qubits of the input of $C$.
        Add modulo $2$ the string $\left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right)$ to $y$ to get $y \oplus \left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right)$ in the right input register.

        \item 
        Execute $R_{\frac{1}{2}}$ on the qubit $x_{n}$, where $R_{\frac{1}{2}}$ is the single-qubit gate:
        $$
        R_{\frac{1}{2}}
        :=
        \begin{pmatrix}
            \frac{1}{2} & -\sqrt{ \frac{3}{4} } \\
            \sqrt{ \frac{3}{4} } & \frac{1}{2}   
        \end{pmatrix}
        \enspace .
        $$
    \end{enumerate}

    \item 
    Else, $\lnot \left( x \sim \varphi^{*} \right)$:
    \begin{enumerate}
        \item
        Execute a bit flip gate $X$ on $x_{n}$.
    \end{enumerate}
\end{enumerate}

It can be verified that $C := C_{\varphi^{*}}$ is a unitary quantum circuit, and induces the $2n$-qubit unitary $U_{C} \in \bbC^{2^{2n} \times 2^{2n}}$:
$$
\sum_{ x, y \in \{ 0, 1 \}^{n} : x \sim \varphi^{*} }
\ket{x_{1, \cdots, n - 1}}
\otimes
\left( \frac{1}{2}\cdot\ket{x_n} + (-1)^{x_n} \sqrt{ \frac{3}{4} } \cdot \ket{\lnot x_{n}} \right)
\otimes
\ket{ y \oplus \left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) }
\bra{ x, y }
$$
$$
+
\sum_{ x, y \in \{ 0, 1 \}^{n} : \lnot \left( x \sim \varphi^{*} \right) }
\ket{x_{1, \cdots, n - 1}, \lnot x_{n}, y}
\bra{ x, y }
\enspace .
$$
By the definition of partial trace (Definition \ref{definition:partial_trace}) one can verify by calculation that $V_{\left( n, C \right)} := \tr_{n}\left( U_{C} \right)$ equals:
$$
\sum_{ x, y \in \{ 0, 1 \}^{n} : x \sim \varphi^{*} }
\frac{1}{2}
\cdot
\ket{ y \oplus \left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) }
\bra{ y }
+
\sum_{ x, y \in \{ 0, 1 \}^{n} : \lnot \left( x \sim \varphi^{*} \right) }
0
\cdot 
\ket{ y }
\bra{ y }
\enspace .
$$
Recall that because $\varphi^{*}$ has a unique satisfying assignment, we are guaranteed there are exactly two $x, x' \in \{ 0, 1 \}^{n}$, $x \neq x'$ such that $x \sim \varphi^{*}$, $x' \sim \varphi^{*}$, and also $\left( x_{1, \cdots, n - 1}, b^{\left( x \right)} \right) = \left( x'_{1, \cdots, n - 1}, b^{\left( x' \right)} \right) = z$, where $z \in \{ 0, 1 \}^{n}$ is the unique satisfying assignment for $\varphi^{*}$. It follows that the above $V_{\left( n, C \right)} := \tr_{n}\left( U_C \right)$ equals
$$
\sum_{ y \in \{ 0, 1 \}^{n} } \ket{ y \oplus z }\bra{ y }
\enspace .
$$
The above matrix $V_{\left( n, C \right)}$ is a unitary matrix, and three things hold: (1) $C$ induces a unitary quantum channel $U_{C}$ on $2n$ qubits, (2) By Lemma \ref{lemma:simplified_isometry_pm} the pair $\left( n, C \right)$ is a PMG, and (3) the channel $\pmo_{\left( n, C \right)} = V_{\left( n, C \right)}$ is unitary. This makes the pair $\left( n, C \right)$ a pure PMG as in Definition \ref{definition:pure_process_matrix_generator}.

The machine $M_{\USAT}$ makes the CTC generation query $A\left( n, C \right)$, which is successful because $\left( n, C \right)$ is a pure PMG. The CTC generator $A$ opens oracle access to the channel $V_{\left( n, C \right)}$, which in turn just adds (in superposition) the unique satisfying assignment $z$ into the input state. Finally, after the CTC generation, $M_{\USAT}$ simply sends the single classical query $\ket{0^n}$ to the channel $V_{\left( n, C \right)}$ to get back $\ket{z}$.
\end{proof}




\newcommand{\etalchar}[1]{$^{#1}$}
\begin{thebibliography}{LMGP{\etalchar{+}}11b}

\bibitem[ABC{\etalchar{+}}15]{araujo2015witnessing}
Mateus Ara{\'u}jo, Cyril Branciard, Fabio Costa, Adrien Feix, Christina
  Giarmatzi, and {\v{C}}aslav Brukner.
\newblock Witnessing causal nonseparability.
\newblock {\em New Journal of Physics}, 17(10):102001, 2015.

\bibitem[ACB14]{araujo2014computational}
Mateus Ara{\'u}jo, Fabio Costa, and {\v{C}}aslav Brukner.
\newblock Computational advantage from quantum-controlled ordering of gates.
\newblock {\em Physical review letters}, 113(25):250402, 2014.

\bibitem[AFCB14]{araujo2014quantum}
Mateus Ara{\'u}jo, Adrien Feix, Fabio Costa, and {\v{C}}aslav Brukner.
\newblock Quantum circuits cannot control unknown operations.
\newblock {\em New Journal of Physics}, 16(9):093026, 2014.

\bibitem[AFNB17]{araujo2017purification}
Mateus Ara{\'u}jo, Adrien Feix, Miguel Navascu{\'e}s, and {\v{C}}aslav Brukner.
\newblock A purification postulate for quantum mechanics with indefinite causal
  order.
\newblock {\em Quantum}, 1:10, 2017.

\bibitem[AGB17]{araujo2017quantum}
Mateus Ara{\'u}jo, Philippe~Allard Gu{\'e}rin, and {\"A}min Baumeler.
\newblock Quantum computation with indefinite causal structures.
\newblock {\em Physical Review A}, 96(5):052315, 2017.

\bibitem[AMRM13]{ahn2013quantum}
Doyeol Ahn, Casey~R Myers, Timothy~C Ralph, and Robert~B Mann.
\newblock Quantum-state cloning in the presence of a closed timelike curve.
\newblock {\em Physical Review A—Atomic, Molecular, and Optical Physics},
  88(2):022332, 2013.

\bibitem[AW09]{aaronson2009closed}
Scott Aaronson and John Watrous.
\newblock Closed timelike curves make quantum and classical computing
  equivalent.
\newblock {\em Proceedings of the Royal Society A: Mathematical, Physical and
  Engineering Sciences}, 465(2102):631--647, 2009.

\bibitem[BAF{\etalchar{+}}15]{branciard2015simplest}
Cyril Branciard, Mateus Ara{\'u}jo, Adrien Feix, Fabio Costa, and {\v{C}}aslav
  Brukner.
\newblock The simplest causal inequalities and their violation.
\newblock {\em New Journal of Physics}, 18(1):013008, 2015.

\bibitem[BFW14]{baumeler2014maximal}
{\"A}min Baumeler, Adrien Feix, and Stefan Wolf.
\newblock Maximal incompatibility of locally classical behavior and global
  causal order in multiparty scenarios.
\newblock {\em Physical Review A}, 90(4):042106, 2014.

\bibitem[BHW09]{brun2009localized}
Todd~A Brun, Jim Harrington, and Mark~M Wilde.
\newblock Localized closed timelike curves can perfectly distinguish quantum
  states.
\newblock {\em Physical Review Letters}, 102(21):210402, 2009.

\bibitem[BS]{bennett2005teleportation}
Charles~H. Bennett and Ben Schumacher.
\newblock {Teleportation, Simulated Time Travel, and How to Flirt with Someone
  Who Has Fallen into a Black Hole.
  \url{http://web.archive.org/web/20060207123032/http://www.research.ibm.com/people/b/bennetc/QUPONBshort.pdf}}.

\bibitem[BW12]{brun2012perfect}
Todd~A Brun and Mark~M Wilde.
\newblock Perfect state distinguishability and computational speedups with
  postselected closed timelike curves.
\newblock {\em Foundations of Physics}, 42:341--361, 2012.

\bibitem[BW14]{baumeler2014perfect}
{\"A}min Baumeler and Stefan Wolf.
\newblock Perfect signaling among three parties violating predefined causal
  order.
\newblock In {\em 2014 IEEE International Symposium on Information Theory},
  pages 526--530. IEEE, 2014.

\bibitem[BWW13]{brun2013quantum}
Todd~A Brun, Mark~M Wilde, and Andreas Winter.
\newblock Quantum state cloning using deutschian closed timelike curves.
\newblock {\em Physical review letters}, 111(19):190401, 2013.

\bibitem[CBB{\etalchar{+}}21]{chiribella2021indefinite}
Giulio Chiribella, Manik Banik, Some~Sankar Bhattacharya, Tamal Guha, Mir
  Alimuddin, Arup Roy, Sutapa Saha, Sristy Agrawal, and Guruprasad Kar.
\newblock Indefinite causal order enables perfect quantum communication with
  zero capacity channels.
\newblock {\em New Journal of Physics}, 23(3):033039, 2021.

\bibitem[CDPV13]{chiribella2013quantum}
Giulio Chiribella, Giacomo~Mauro D’Ariano, Paolo Perinotti, and Benoit
  Valiron.
\newblock Quantum computations without definite causal structure.
\newblock {\em Physical Review A}, 88(2):022318, 2013.

\bibitem[Chi12]{chiribella2012perfect}
Giulio Chiribella.
\newblock Perfect discrimination of no-signalling channels via quantum
  superposition of causal structures.
\newblock {\em Physical Review A—Atomic, Molecular, and Optical Physics},
  86(4):040301, 2012.

\bibitem[Deu91]{deutsch1991quantum}
David Deutsch.
\newblock Quantum mechanics near closed timelike lines.
\newblock {\em Physical Review D}, 44(10):3197, 1991.

\bibitem[FV20]{felce2020quantum}
David Felce and Vlatko Vedral.
\newblock Quantum refrigeration with indefinite causal order.
\newblock {\em Physical review letters}, 125(7):070603, 2020.

\bibitem[GAP20]{guha2020thermodynamic}
Tamal Guha, Mir Alimuddin, and Preeti Parashar.
\newblock Thermodynamic advancement in the causally inseparable occurrence of
  thermal maps.
\newblock {\em Physical Review A}, 102(3):032215, 2020.

\bibitem[GFAB16]{guerin2016exponential}
Philippe~Allard Gu{\'e}rin, Adrien Feix, Mateus Ara{\'u}jo, and {\v{C}}aslav
  Brukner.
\newblock Exponential communication complexity advantage from quantum
  superposition of the direction of communication.
\newblock {\em Physical review letters}, 117(10):100502, 2016.

\bibitem[G{\"o}d49]{godel1949example}
Kurt G{\"o}del.
\newblock An example of a new type of cosmological solutions of einstein's
  field equations of gravitation.
\newblock {\em Reviews of modern physics}, 21(3):447, 1949.

\bibitem[Haw92]{hawking1992chronology}
Stephen~W Hawking.
\newblock Chronology protection conjecture.
\newblock {\em Physical Review D}, 46(2):603, 1992.

\bibitem[Kar10]{karp2010reducibility}
Richard~M Karp.
\newblock {\em Reducibility among combinatorial problems}.
\newblock Springer, 2010.

\bibitem[LMGP{\etalchar{+}}11a]{lloyd2011quantum}
Seth Lloyd, Lorenzo Maccone, Raul Garcia-Patron, Vittorio Giovannetti, and
  Yutaka Shikano.
\newblock Quantum mechanics of time travel through post-selected teleportation.
\newblock {\em Physical Review D—Particles, Fields, Gravitation, and
  Cosmology}, 84(2):025007, 2011.

\bibitem[LMGP{\etalchar{+}}11b]{lloyd2011closed}
Seth Lloyd, Lorenzo Maccone, Raul Garcia-Patron, Vittorio Giovannetti, Yutaka
  Shikano, Stefano Pirandola, Lee~A Rozema, Ardavan Darabi, Yasaman Soudagar,
  Lynden~K Shalm, et~al.
\newblock Closed timelike curves via postselection: theory and experimental
  test of consistency.
\newblock {\em Physical review letters}, 106(4):040403, 2011.

\bibitem[MTY88]{morris1988wormholes}
Michael~S Morris, Kip~S Thorne, and Ulvi Yurtsever.
\newblock Wormholes, time machines, and the weak energy condition.
\newblock {\em Physical Review Letters}, 61(13):1446, 1988.

\bibitem[Nov89]{novikov1989analysis}
Igor~Dmitriyevich Novikov.
\newblock Analysis of the operation of a time machine.
\newblock {\em Zhurnal Eksperimentalnoi i Teoreticheskoi Fiziki}, 95:769--776,
  1989.

\bibitem[OCB12]{oreshkov2012quantum}
Ognyan Oreshkov, Fabio Costa, and {\v{C}}aslav Brukner.
\newblock Quantum correlations with no causal order.
\newblock {\em Nature communications}, 3(1):1092, 2012.

\bibitem[OG16]{oreshkov2016causal}
Ognyan Oreshkov and Christina Giarmatzi.
\newblock Causal and causally separable processes.
\newblock {\em New Journal of Physics}, 18(9):093020, 2016.

\bibitem[Pol94]{politzer1994path}
H~David Politzer.
\newblock Path integrals, density matrices, and information flow with closed
  timelike curves.
\newblock {\em Physical Review D}, 49(8):3981, 1994.

\bibitem[PRM13]{pienaar2013open}
Jacques~L Pienaar, Timothy~C Ralph, and Casey~R Myers.
\newblock Open timelike curves violate heisenberg’s uncertainty principle.
\newblock {\em Physical review letters}, 110(6):060501, 2013.

\bibitem[Reg09]{regev2009lattices}
Oded Regev.
\newblock On lattices, learning with errors, random linear codes, and
  cryptography.
\newblock {\em Journal of the ACM (JACM)}, 56(6):1--40, 2009.

\bibitem[Sve11]{svetlichny2011time}
George Svetlichny.
\newblock Time travel: Deutsch vs. teleportation.
\newblock {\em International Journal of Theoretical Physics},
  50(12):3903--3914, 2011.

\bibitem[VS38]{van1938ix}
Willem~Jacob Van~Stockum.
\newblock Ix.—the gravitational field of a distribution of particles rotating
  about an axis of symmetry.
\newblock {\em Proceedings of the Royal Society of Edinburgh}, 57:135--154,
  1938.

\bibitem[VV85]{valiant1985np}
Leslie~G Valiant and Vijay~V Vazirani.
\newblock Np is as easy as detecting unique solutions.
\newblock In {\em Proceedings of the seventeenth annual ACM symposium on Theory
  of computing}, pages 458--463, 1985.

\bibitem[WDAB21]{wechs2021quantum}
Julian Wechs, Hippolyte Dourdent, Alastair~A Abbott, and Cyril Branciard.
\newblock Quantum circuits with classical versus quantum control of causal
  order.
\newblock {\em PRX Quantum}, 2(3):030335, 2021.

\bibitem[ZYC20]{zhao2020quantum}
Xiaobin Zhao, Yuxiang Yang, and Giulio Chiribella.
\newblock Quantum metrology with indefinite causal order.
\newblock {\em Physical Review Letters}, 124(19):190503, 2020.

\end{thebibliography}