<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://qetlab.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rmmateri</id>
	<title>QETLAB - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rmmateri"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/Special:Contributions/Rmmateri"/>
	<updated>2026-06-13T15:07:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=939</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=939"/>
		<updated>2018-08-28T11:55:48Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Entanglement measures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Concurrence]]&amp;lt;/tt&amp;gt;: Computes the concurrence of a 2-qubit state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[EntFormation]]&amp;lt;/tt&amp;gt;: Computes the entanglement of formation of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomRobustnessEntanglement]]&amp;lt;/tt&amp;gt;: Computes the random robustness of entanglement of a bipartite quantum state&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=938</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=938"/>
		<updated>2018-08-28T11:55:26Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Random things */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Concurrence]]&amp;lt;/tt&amp;gt;: Computes the concurrence of a 2-qubit state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[EntFormation]]&amp;lt;/tt&amp;gt;: Computes the entanglement of formation of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=937</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=937"/>
		<updated>2018-08-14T12:59:38Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Entanglement measures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Concurrence]]&amp;lt;/tt&amp;gt;: Computes the concurrence of a 2-qubit state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[EntFormation]]&amp;lt;/tt&amp;gt;: Computes the entanglement of formation of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomRobustnessEntanglement]]&amp;lt;/tt&amp;gt;: Computes the random robustness of entanglement of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=936</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=936"/>
		<updated>2018-08-14T12:49:25Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Unextendible product bases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomRobustnessEntanglement]]&amp;lt;/tt&amp;gt;: Computes the random robustness of entanglement of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=935</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=935"/>
		<updated>2018-08-14T12:48:38Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Unextendible product bases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomRobustnessEntanglement]]&amp;lt;/tt&amp;gt;: Computes the random robustness of entanglement of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not a UPB is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=934</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=934"/>
		<updated>2018-08-14T12:47:00Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Random things */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomRobustnessEntanglement]]&amp;lt;/tt&amp;gt;: Computes the random robustness of entanglement of a bipartite quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=933</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=933"/>
		<updated>2018-08-06T12:57:05Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Helper functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[bcs_to_nonlocal]]&amp;lt;/tt&amp;gt;: Converts a constraint description of a binary constraint system (BCS) game to a general non-local game description&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=932</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=932"/>
		<updated>2018-08-06T12:43:15Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Nonlocality and Bell inequalities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a binary contraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameLB]]&amp;lt;/tt&amp;gt;: Computes a lower bound on the quantum value of a non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Template:DownloadBox&amp;diff=931</id>
		<title>Template:DownloadBox</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Template:DownloadBox&amp;diff=931"/>
		<updated>2018-07-20T11:56:44Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;border:2px outset #dddddd;background:#eeeeee;margin:12px auto 5px auto;padding:5px;white-space:nowrap;width:75%;min-width:620px;&amp;quot;&amp;gt;&lt;br /&gt;
{| style=&amp;quot;background:#eeeeee;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | [[File:download.gif|link={{DownloadLink}}.zip]]&lt;br /&gt;
|&amp;lt;span style=&amp;quot;padding-left:10px;font-size:130%;font-weight:bold;&amp;quot;&amp;gt;Download and Install QETLAB&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;div style=&amp;quot;padding:4px 0 0 12px;&amp;quot;&amp;gt;&#039;&#039;&#039;Step 1:&#039;&#039;&#039; Download [{{DownloadLink}}.zip QETLAB] (current version: {{CurrentVersion}}, last updated: {{LastUpdated}})&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;padding:4px 0 0 12px;&amp;quot;&amp;gt;&#039;&#039;&#039;Step 2:&#039;&#039;&#039; Unzip the file in your MATLAB scripts directory&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;padding:4px 0 0 12px;&amp;quot;&amp;gt;&#039;&#039;&#039;Step 3:&#039;&#039;&#039; Download and install [http://cvxr.com/cvx/ CVX 2.1]&amp;lt;/div&amp;gt;{{#ifeq: {{PAGENAME}} | Installation | | &amp;lt;div style=&amp;quot;font-size:90%; padding:8px 0 0 12px;&amp;quot;&amp;gt;If you need more detailed installation instructions, [[Installation|click here]].&amp;lt;/div&amp;gt;}}&lt;br /&gt;
|}&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Installation&amp;diff=930</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Installation&amp;diff=930"/>
		<updated>2018-07-20T11:20:38Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Step 3: Download and install CVX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__This page will guide you through &#039;&#039;&#039;downloading and installing&#039;&#039;&#039; QETLAB. This process should be quick and easy (taking roughly 5 minutes). First try following the instructions in the following box. If you do not have any trouble following these instructions and getting everything working, then great! If you need more detailed instructions, continue reading below.&lt;br /&gt;
{{DownloadBox}}&lt;br /&gt;
&lt;br /&gt;
==More detailed instructions==&lt;br /&gt;
Here we will expand on the three steps that we outlined above, in case you have any trouble completing any of them.&lt;br /&gt;
&lt;br /&gt;
===Step 1: Download QETLAB===&lt;br /&gt;
This step is easy enough. Simply download one of the following two files, depending on which operating system you are using.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Windows/Mac&lt;br /&gt;
! Linux&lt;br /&gt;
|-&lt;br /&gt;
| [{{DownloadLink}}.zip QETLAB v{{CurrentVersion}}] (.zip archive)&lt;br /&gt;
| [{{DownloadLink}}.tar.gz QETLAB v{{CurrentVersion}}] (.tar.gz archive)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Step 2: Unzip the file in your MATLAB scripts directory===&lt;br /&gt;
First, extract the .zip or .tar.gz archive (every modern operating system has built-in tools for extracting archives like this) &amp;amp;ndash; this will create a directory called &amp;quot;&amp;lt;tt&amp;gt;QETLAB-{{CurrentVersion}}&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* If you know where your MATLAB scripts directory is and you are comfortable adding scripts to MATLAB&#039;s path, then do so with QETLAB (and its subfolders).&lt;br /&gt;
&lt;br /&gt;
* Otherwise, move the &amp;quot;&amp;lt;tt&amp;gt;QETLAB-{{CurrentVersion}}&amp;lt;/tt&amp;gt;&amp;quot; directory to wherever you want it on your computer (for the sake of these instructions, let&#039;s suppose that the directory is now located at &amp;lt;tt&amp;gt;C:\Users\Nathaniel\MyFiles\QETLAB-{{CurrentVersion}}&amp;lt;/tt&amp;gt;). Then, within MATLAB, type the following (replacing the path &amp;lt;tt&amp;gt;C:\Users...&amp;lt;/tt&amp;gt; with whatever the path is on your own computer):&lt;br /&gt;
: &amp;lt;tt&amp;gt;addpath(genpath(&#039;C:\Users\Nathaniel\MyFiles\QETLAB-{{CurrentVersion}}&#039;))&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to use some of basic functions of QETLAB. For example, you could try running the following two lines of code, which generate a random density matrix and then check whether or not it has positive partial transpose:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = RandomDensityMatrix(9);&lt;br /&gt;
&amp;gt;&amp;gt; IsPPT(rho)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 3: Download and install CVX===&lt;br /&gt;
[[File:CVX_needed.png|thumb|right|360px|Part of the documentation of the &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt; function, showing that this function requires CVX to work.]]While this step is not necessary if you only care about some of QETLAB&#039;s most basic functions, it is needed to unlock many of the advanced features of QETLAB. [http://cvxr.com/cvx/ CVX] is a free convex optimization toolbox for MATLAB that is &#039;&#039;heavily&#039;&#039; integrated with QETLAB. Many of QETLAB&#039;s advanced functions rely on CVX (if a QETLAB function requires CVX, it will say so at the top-right corner of its [[List_of_functions|documentation page]]), and in general CVX is just handy to have around.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE! Currently CVX 2.1 is the stable version and is compatible with QETLAB. USE CVX 3.0b AT YOUR OWN RISK! &lt;br /&gt;
&lt;br /&gt;
To download and install CVX, follow the &#039;&#039;&#039;[http://cvxr.com/cvx/download/ instructions on the CVX website]&#039;&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=929</id>
		<title>Pad array</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=929"/>
		<updated>2018-07-18T16:22:28Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=pad_array&lt;br /&gt;
|desc=Pads an array with zeroes in a similar way to padarray in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 18th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;pad_array&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes an array and either prepends or postpends a number of zeroes specified by the function call. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = pad_array(ARR, PAD_NUM, DIR)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;: The array which will have zeroes padded onto it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;PAD_NUM&amp;lt;/tt&amp;gt;: The number of zeroes to either prepend or postpend onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. This must be a non-negative integer.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIR&amp;lt;/tt&amp;gt;: An integer specifying whether to prepend or postpend the zeroes onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. 0 means to prepend, 1 means to postpend, and any other number will throw an error. &lt;br /&gt;
==Examples==&lt;br /&gt;
A basic example of how pad_array works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; arr = [1,2,3,4];&lt;br /&gt;
&amp;gt;&amp;gt; pad_array(arr, 2, 0)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     0     1     2     3     4&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; pad_array(arr, 2, 1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     2     3     4     0     0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the image processing package of MATLAB or Octave-Forge. Note that this function only pads with zeroes. If other numbers are required, please use the `padarray&#039; function within the image processing toolbox of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=928</id>
		<title>Pad array</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=928"/>
		<updated>2018-07-18T16:21:49Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: Created page with &amp;quot;{{Function |name=pad_array |desc=Pads an array with zeroes in a similar way to padarray in MATLAB. |cat=Helper functions |upd=July 18th,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=pad_array&lt;br /&gt;
|desc=Pads an array with zeroes in a similar way to padarray in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 18th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;pad_array&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes an array and either prepends or postpends a number of zeroes specified by the function call. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = pad_array(ARR, PAD_NUM, DIR)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;: The array which will have zeroes padded onto it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;PAD_NUM&amp;lt;/tt&amp;gt;: The number of zeroes to either prepend or postpend onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. This must be a non-negative integer.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIR&amp;lt;/tt&amp;gt;: An integer specifying whether to prepend or postpend the zeroes onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. 0 means to prepend, 1 means to postpend, and any other number will throw an error. &lt;br /&gt;
==Examples==&lt;br /&gt;
Some basic examples of how pad_array works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; arr = [1,2,3,4];&lt;br /&gt;
&amp;gt;&amp;gt; pad_array(arr, 2, 0)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     0     1     2     3     4&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; pad_array(arr, 2, 1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     2     3     4     0     0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the image processing package of MATLAB or Octave-Forge. Note that this function only pads with zeroes. If other numbers are required, please use the `padarray&#039; function within the image processing toolbox of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=927</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=927"/>
		<updated>2018-07-18T12:15:12Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `de2bi&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=926</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=926"/>
		<updated>2018-07-18T11:58:47Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `dec2bin&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pad_array]]&amp;lt;/tt&amp;gt;: Pads an array with zeroes in a similar way to `padarray&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=925</id>
		<title>Dec to bin</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=925"/>
		<updated>2018-07-18T11:40:12Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=dec_to_bin&lt;br /&gt;
|desc=Converts a number to its binary form in a similar way to the de2bi function in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 6th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;dec_to_bin&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes a number as input and converts it to a vector representing the binary form of the number with the MSB to the right. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = dec_to_bin(DEC)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;: The number to be converted to a vector representing the binary form of &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;. This must be a non-negative integer. &lt;br /&gt;
==Examples==&lt;br /&gt;
Some basic examples of how dec_to_bin works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(5)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     0     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(6)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     1     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the communications package of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=924</id>
		<title>Dec to bin</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=924"/>
		<updated>2018-07-18T11:38:56Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=dec_to_bin&lt;br /&gt;
|desc=Converts a decimal number to a binary number in a similar way to the de2bi function in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 6th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;dec_to_bin&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes a decimal number as input and converts it to a vector representing the binary form of the number with the MSB to the right. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = dec_to_bin(DEC)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;: The decimal number to be converted to a vector representing the binary form of &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;. This must be a non-negative integer. &lt;br /&gt;
==Examples==&lt;br /&gt;
Some basic examples of how dec_to_bin works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(5)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     0     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(6)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     1     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the communications package of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=923</id>
		<title>Dec to bin</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=923"/>
		<updated>2018-07-18T11:38:19Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=dec_to_bin&lt;br /&gt;
|desc=Converts a decimal number to a binary number in a similar way to the dec2bin function in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 6th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;dec_to_bin&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes a decimal number as input and converts it to a vector representing the binary form of the number with the MSB to the right. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = dec_to_bin(DEC)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;: The decimal number to be converted to a vector representing the binary form of &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;. This must be a non-negative integer. &lt;br /&gt;
==Examples==&lt;br /&gt;
Some basic examples of how dec_to_bin works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(5)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     0     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(6)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     1     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the communications package of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=922</id>
		<title>Dec to bin</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=922"/>
		<updated>2018-07-18T11:37:48Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=dec_to_bin&lt;br /&gt;
|desc=Converts a decimal number to a binary number in a similar way to the dec2bin function in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 6th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;dec_to_bin&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes a decimal number as input and converts it to a vector representing the binary form of the number with the MSB to the right. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = dec_to_bin(DEC)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;: The decimal number to be converted to a vector representing the binary form of &amp;lt;tt&amp;gt;DEC&amp;lt;/tt&amp;gt;. This must be a non-negative integer. &lt;br /&gt;
==Examples==&lt;br /&gt;
Some basic examples of how dec_to_bin works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(5)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     0     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; dec_to_bin(6)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     1     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the communications package of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=dec_to_bin|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=921</id>
		<title>Dec to bin</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Dec_to_bin&amp;diff=921"/>
		<updated>2018-07-06T19:13:31Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: Created page with &amp;quot;{{Function |name=dec_to_bin |desc=Converts a decimal number to a binary number in a similar way to the dec2bin function in MATLAB. |cat=List of functions#Helper_functions|He...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=dec_to_bin&lt;br /&gt;
|desc=Converts a decimal number to a binary number in a similar way to the dec2bin function in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 6th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;dec_to_bin&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the identity matrix of the desired size, which is either full or sparse.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;ID = iden(DIM,SP)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt;: The number of rows (or equivalently, columns) that &amp;lt;tt&amp;gt;ID&amp;lt;/tt&amp;gt; will have.&lt;br /&gt;
* &amp;lt;tt&amp;gt;SP&amp;lt;/tt&amp;gt;: A flag (either 1 or 0) indicating whether &amp;lt;tt&amp;gt;ID&amp;lt;/tt&amp;gt; should or should not be sparse.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Full and sparse versions of the 2-by-2 identity matrix:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; iden(2,0)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     0&lt;br /&gt;
     0     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; iden(2,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   (1,1)        1&lt;br /&gt;
   (2,2)        1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the package dec2bin. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=920</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=920"/>
		<updated>2018-07-06T18:57:31Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Helper functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[dec_to_bin]]&amp;lt;/tt&amp;gt;: Converts a decimal number to a binary number in a similar way to `dec2bin&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=919</id>
		<title>List of functions</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=List_of_functions&amp;diff=919"/>
		<updated>2018-07-06T18:56:56Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: /* Helper functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a &#039;&#039;&#039;list of functions&#039;&#039;&#039; provided by QETLAB, arranged by category. If you would prefer an alphabetical list of all functions please see [[:Category:Functions|this page]]. Brief descriptions of these functions are provided here, as well as links to their documentation pages, where full details and numerous examples can be found.&lt;br /&gt;
&lt;br /&gt;
==Basic operations==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPSD]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is positive semidefinite&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Tensor]]&amp;lt;/tt&amp;gt;: Kronecker tensor product of two or more matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TensorSum]]&amp;lt;/tt&amp;gt;: Computes a vector or operator from its tensor decomposition&lt;br /&gt;
&lt;br /&gt;
==Coherence and incoherence==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[L1NormCoherence]]&amp;lt;/tt&amp;gt;: Computes the ℓ&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;-norm of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RelEntCoherence]]&amp;lt;/tt&amp;gt;: Computes the relative entropy of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RobustnessCoherence]]&amp;lt;/tt&amp;gt;: Computes the robustness of coherence of a quantum state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceDistanceCoherence]]&amp;lt;/tt&amp;gt;: Computes the trace distance of coherence of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Distinguishing objects==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChannelDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Distinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[LocalDistinguishability]]&amp;lt;/tt&amp;gt;: Computes the maximum probability of distinguishing quantum states by symmetric-extendible and/or PPT measurements&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPBSepDistinguishable]]&amp;lt;/tt&amp;gt;: Determines whether or not an unextendible product basis is distinguishable by separable measurements&lt;br /&gt;
&lt;br /&gt;
==Entanglement and separability==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductVector]]&amp;lt;/tt&amp;gt;: Determines if a pure state is a product vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the Schmidt decomposition of a bipartite vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the Schmidt rank of a bipartite vector&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FilterNormalForm]]&amp;lt;/tt&amp;gt;: Computes the filter normal form of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsBlockPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator is block positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsEntanglingGate]]&amp;lt;/tt&amp;gt;: Determines if a unitary is an entangling gate&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix has positive partial transpose&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsProductOperator]]&amp;lt;/tt&amp;gt;: Determines if an operator is an elementary tensor&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsSeparable]]&amp;lt;/tt&amp;gt;: Determines whether or not a bipartite operator is separable&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt decomposition of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSchmidtRank]]&amp;lt;/tt&amp;gt;: Computes the operator Schmidt rank of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric extension&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricInnerExtension]]&amp;lt;/tt&amp;gt;: Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
&lt;br /&gt;
===Ball of separability===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AbsPPTConstraints]]&amp;lt;/tt&amp;gt;: Builds the eigenvalue matrices that determine whether or not a state is absolutely PPT&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InSeparableBall]]&amp;lt;/tt&amp;gt;: Checks whether or not an operator is in the ball of separability centered at the maximally-mixed state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsAbsPPT]]&amp;lt;/tt&amp;gt;: Determines whether or not a density matrix is absolutely PPT&lt;br /&gt;
&lt;br /&gt;
===Entanglement measures===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Negativity]]&amp;lt;/tt&amp;gt;: Computes the negativity of a bipartite density matrix&lt;br /&gt;
&lt;br /&gt;
==Information theory==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Entropy]]&amp;lt;/tt&amp;gt;: Computes the von Neumann or Rényi entropy of a density matrix&lt;br /&gt;
&lt;br /&gt;
==Nonlocality and Bell inequalities==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BCSGameValue]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt;: Computes the maximum value of a Bell inequality&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BellInequalityMaxQubits]]&amp;lt;/tt&amp;gt;: Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NonlocalGameValue]]&amp;lt;/tt&amp;gt;: Computes the value of a two-player non-local game&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[NPAHierarchy]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of probabilities satisfy the conditions of the NPA hierarchy&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[XORGameValue]]&amp;lt;/tt&amp;gt;: Computes the classical or quantum value of a non-local binary XOR game&lt;br /&gt;
&lt;br /&gt;
==Norms and distance measures==&lt;br /&gt;
===Vectors and pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkVectorNorm]]&amp;lt;/tt&amp;gt;: Computes the s(k)-norm of a vector&lt;br /&gt;
&lt;br /&gt;
===Operators and mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Fidelity]]&amp;lt;/tt&amp;gt;: Computes the fidelity of two density matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedMatrixNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced p&amp;amp;rarr;q norm of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNorm]]&amp;lt;/tt&amp;gt;: Computes the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[kpNormDual]]&amp;lt;/tt&amp;gt;: Computes the dual of the (k,p)-norm of a vector or matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KyFanNorm]]&amp;lt;/tt&amp;gt;: Computes the Ky Fan k-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SkOperatorNorm]]&amp;lt;/tt&amp;gt;: Bounds the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SchattenNorm]]&amp;lt;/tt&amp;gt;: Computes the Schatten p-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[TraceNorm]]&amp;lt;/tt&amp;gt;: Computes the trace norm of an operator&lt;br /&gt;
&lt;br /&gt;
===Superoperators and channels===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[CBNorm]]&amp;lt;/tt&amp;gt;: Computes the completely bounded norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt;: Computes the diamond norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[InducedSchattenNorm]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the induced Schatten p&amp;amp;rarr;q norm of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaximumOutputFidelity]]&amp;lt;/tt&amp;gt;: Computes the maximum output fidelity of two quantum channels&lt;br /&gt;
&lt;br /&gt;
==Permutations and symmetry of subsystems==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[AntisymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the antisymmetric subspace&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermutationOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that permutes subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PermuteSystems]]&amp;lt;/tt&amp;gt;: Permutes subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Swap]]&amp;lt;/tt&amp;gt;: Swaps two subsystems within a state or operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SwapOperator]]&amp;lt;/tt&amp;gt;: Produces a unitary operator that swaps two subsystems&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[SymmetricProjection]]&amp;lt;/tt&amp;gt;: Produces the projection onto the symmetric subspace&lt;br /&gt;
&lt;br /&gt;
==Random things==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomDensityMatrix]]&amp;lt;/tt&amp;gt;: Generates a random density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomPOVM]]&amp;lt;/tt&amp;gt;: Generates a random POVM (positive-operator valued measure)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomProbabilities]]&amp;lt;/tt&amp;gt;: Computes a random probability vector, distributed uniformly on the unit simplex&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomStateVector]]&amp;lt;/tt&amp;gt;: Generates a random pure state vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomSuperoperator]]&amp;lt;/tt&amp;gt;: Generates a random superoperator (completely positive map)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[RandomUnitary]]&amp;lt;/tt&amp;gt;: Generates a random unitary or orthogonal matrix&lt;br /&gt;
&lt;br /&gt;
==Special states, vectors, and operators==&lt;br /&gt;
===Pure states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Bell]]&amp;lt;/tt&amp;gt;: Produces a Bell state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BrauerStates]]&amp;lt;/tt&amp;gt;: Produces all Brauer states&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DickeState]]&amp;lt;/tt&amp;gt;: Generates a Dicke state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GHZState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) GHZ state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MaxEntangled]]&amp;lt;/tt&amp;gt;: Produces a maximally entangled bipartite pure state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WState]]&amp;lt;/tt&amp;gt;: Generates a (generalized) W-state&lt;br /&gt;
&lt;br /&gt;
===Mixed states===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[BreuerState]]&amp;lt;/tt&amp;gt;: Generates a Breuer state, which is a specific family of bound entangled states on even local dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChessboardState]]&amp;lt;/tt&amp;gt;: Produces a chessboard state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GisinState]]&amp;lt;/tt&amp;gt;: Generates a 2-qubit Gisin state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[HorodeckiState]]&amp;lt;/tt&amp;gt;: Generates a bound entangled &amp;quot;Horodecki&amp;quot; state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsotropicState]]&amp;lt;/tt&amp;gt;: Produces an isotropic state&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[WernerState]]&amp;lt;/tt&amp;gt;: Produces a Werner state&lt;br /&gt;
&lt;br /&gt;
===Other operators===&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[FourierMatrix]]&amp;lt;/tt&amp;gt;: Generates the unitary matrix that implements the quantum Fourier transform&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GellMann]]&amp;lt;/tt&amp;gt;: Produces a Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenGellMann]]&amp;lt;/tt&amp;gt;: Produces a generalized Gell-Mann operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[GenPauli]]&amp;lt;/tt&amp;gt;: Produces a generalized Pauli operator (sometimes called a Weyl operator)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Pauli]]&amp;lt;/tt&amp;gt;: Produces a Pauli operator&lt;br /&gt;
&lt;br /&gt;
==Superoperators==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ApplyMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMatrix]]&amp;lt;/tt&amp;gt;: Computes the Choi matrix of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ChoiMap]]&amp;lt;/tt&amp;gt;: Produces the Choi map or one of its generalizations&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ComplementaryMap]]&amp;lt;/tt&amp;gt;: Computes the complementary map of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DephasingChannel]]&amp;lt;/tt&amp;gt;: Produces a dephasing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DepolarizingChannel]]&amp;lt;/tt&amp;gt;: Produces a depolarizing channel&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[DualMap]]&amp;lt;/tt&amp;gt;: Computes the dual of a superoperator in the Hilbert-Schmidt inner product&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsCP]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is completely positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsHermPreserving]]&amp;lt;/tt&amp;gt;: Determines whether or not a superoperator is Hermiticity preserving&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[KrausOperators]]&amp;lt;/tt&amp;gt;: Computes a set of Kraus operators for a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialMap]]&amp;lt;/tt&amp;gt;: Applies a superoperator to a subsystem of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTrace]]&amp;lt;/tt&amp;gt;: Computes the partial trace of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PartialTranspose]]&amp;lt;/tt&amp;gt;: Computes the partial transpose of a matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[PauliChannel]]&amp;lt;/tt&amp;gt;: Generates a Pauli channel (i.e., a quantum channel with Pauli Kraus operators)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Realignment]]&amp;lt;/tt&amp;gt;: Computes the realignment of a bipartite operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ReductionMap]]&amp;lt;/tt&amp;gt;: Produces the reduction map&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Twirl]]&amp;lt;/tt&amp;gt;: Twirls a bipartite or multipartite operator&lt;br /&gt;
&lt;br /&gt;
==Unextendible product bases==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsUPB]]&amp;lt;/tt&amp;gt;: Determines whether or not a set of product vectors form a UPB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[MinUPBSize]]&amp;lt;/tt&amp;gt;: Gives the minimum cardinality of an unextendible product basis in given dimensions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[UPB]]&amp;lt;/tt&amp;gt;: Generates an unextendible product basis&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Commutant]]&amp;lt;/tt&amp;gt;: Computes the commutant of a set of matrices&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyNonsingular]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally nonsingular&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[IsTotallyPositive]]&amp;lt;/tt&amp;gt;: Determines whether or not a matrix is totally positive&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Majorizes]]&amp;lt;/tt&amp;gt;: Determines whether or not a vector or matrix majorizes another&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[OperatorSinkhorn]]&amp;lt;/tt&amp;gt;: Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[Purity]]&amp;lt;/tt&amp;gt;: Computes the purity of a quantum state&lt;br /&gt;
&lt;br /&gt;
==Helper functions==&lt;br /&gt;
These are functions that only serve auxiliary roles within other functions of QETLAB. As an end-user of QETLAB, you likely won&#039;t have any use for these functions, but they are listed here anyway just in case.&lt;br /&gt;
8 &amp;lt;tt&amp;gt;[[dec_to_bin]]: Converts a decimal number to a binary number in a similar way to `dec2bin&#039; in MATLAB&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[iden]]&amp;lt;/tt&amp;gt;: Computes a sparse or full identity matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[jacobi_poly]]&amp;lt;/tt&amp;gt;: Computes the coefficients of Jacobi polynomials&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[normalize_cols]]&amp;lt;/tt&amp;gt;: Scales the columns of a matrix to have norm 1&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[one_factorization]]&amp;lt;/tt&amp;gt;: Computes a 1-factorization of a list of objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_args]]&amp;lt;/tt&amp;gt;: Handles optional input arguments for functions&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[opt_disp]]&amp;lt;/tt&amp;gt;: Display a message to the user (sometimes)&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perfect_matchings]]&amp;lt;/tt&amp;gt;: Gives all perfect matchings of N objects&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_inv]]&amp;lt;/tt&amp;gt;: Computes the inverse of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[perm_sign]]&amp;lt;/tt&amp;gt;: Computes the sign of a permutation&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[pure_to_mixed]]&amp;lt;/tt&amp;gt;: Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sk_iterate]]&amp;lt;/tt&amp;gt;: Computes a lower bound of the S(k)-norm of an operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[spnull]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the null space&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[sporth]]&amp;lt;/tt&amp;gt;: Returns a sparse orthonormal basis for the range&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[superoperator_dims]]&amp;lt;/tt&amp;gt;: Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[unique_perms]]&amp;lt;/tt&amp;gt;: Computes all distinct permutations of a given vector&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[update_odometer]]&amp;lt;/tt&amp;gt;: Increases the entries of a vector subject to constraints on how large the entries of that vector can be&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[vec_partitions]]&amp;lt;/tt&amp;gt;: Produces all possible partitions of a vector&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=DiamondNorm&amp;diff=917</id>
		<title>DiamondNorm</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=DiamondNorm&amp;diff=917"/>
		<updated>2018-06-13T16:40:10Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=DiamondNorm&lt;br /&gt;
|desc=Computes the [[diamond norm]] of a superoperator&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[CBNorm]]&amp;lt;br /&amp;gt;[[InducedSchattenNorm]]&amp;lt;br /&amp;gt;[[MaximumOutputFidelity]]&lt;br /&gt;
|cat=[[List of functions#Norms|Norms]]&lt;br /&gt;
|upd=November 21, 2014&lt;br /&gt;
|cvx=yes (convex)}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;DiamondNorm&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the diamond norm $\|\Phi\|_\diamond$ of a superoperator $\Phi$.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DN = DiamondNorm(PHI)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;DN = DiamondNorm(PHI,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;: A superoperator. Should be provided as either a Choi matrix, or as a cell with either 1 or 2 columns (see the [[tutorial]] page for more details about specifying superoperators within QETLAB). &amp;lt;tt&amp;gt;PHIC&amp;lt;/tt&amp;gt; will be a cell of Kraus operators if &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; is a cell of Kraus operators, and similarly &amp;lt;tt&amp;gt;PHIC&amp;lt;/tt&amp;gt; will be a Choi matrix if &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; is a Choi matrix.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, default has input and output spaces of equal dimension): A 1-by-2 vector containing the input and output dimensions of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;, in that order (equivalently, these are the dimensions of the first and second subsystems of the Choi matrix &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;, in that order). If the input or output space is not square, then &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt;&#039;s first row should contain the input and output row dimensions, and its second row should contain its input and output column dimensions. &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; is required if and only if &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; has unequal input and output dimensions and is provided as a Choi matrix.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===A completely positive map===&lt;br /&gt;
If $\Phi$ is completely positive then $\|\Phi\|_{\diamond} = \|\Phi^\dagger(I)\|$, where $I$ is the identity matrix, $\Phi^\dagger$ is the dual map of $\Phi$, and $\|\cdot\|$ is the usual operator norm, which we can verify in a special case via the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; Phi = {[1 2;3 4] ; [0 1;2 0] ; [1 1;-1 3]};&lt;br /&gt;
&amp;gt;&amp;gt; DiamondNorm(Phi)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   37.6510&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; norm(ApplyMap(eye(2),DualMap(Phi)))&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   37.6510&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===A difference of unitaries channel===&lt;br /&gt;
If $\Phi(X) = X - UXU^\dagger$, then the diamond norm of $\Phi$ is the diameter of the smallest circle that contains the eigenvalues of $U$, which we can verify in a special case via the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; U = [1 1;-1 1]/sqrt(2);&lt;br /&gt;
&amp;gt;&amp;gt; Phi = {eye(2),eye(2); U,-U};&lt;br /&gt;
&amp;gt;&amp;gt; DiamondNorm(Phi)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    1.4142&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; lam = eig(U)&lt;br /&gt;
&lt;br /&gt;
lam =&lt;br /&gt;
&lt;br /&gt;
   0.7071 + 0.7071i&lt;br /&gt;
   0.7071 - 0.7071i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; abs(lam(1) - lam(2))&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    1.4142&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Can be used within CVX===&lt;br /&gt;
The diamond norm is convex (like all norms) and this function can be used in the same way as any other convex function within CVX. Thus you can minimize the diamond norm or use the diamond norm in constraints of CVX optimization problems. For example, the following code finds the closest Pauli channel (i.e., channel with Kraus operators all of which are multiples of Pauli matrices) to a given 2-qubit channel, where the measure of &amp;quot;closest&amp;quot; is the diamond norm:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; num_qubits = 2;&lt;br /&gt;
&amp;gt;&amp;gt; H = [1,1;1,-1]/sqrt(2); % Hadamard gate&lt;br /&gt;
&amp;gt;&amp;gt; Psi = ChoiMatrix({Tensor(H,num_qubits)}); % channel that acts as Hadamard gate on 2 qubits&lt;br /&gt;
&amp;gt;&amp;gt; cvx_begin sdp quiet&lt;br /&gt;
   variable Phi(4^num_qubits,4^num_qubits) hermitian;&lt;br /&gt;
   variable p(4^num_qubits);&lt;br /&gt;
 &lt;br /&gt;
   minimize DiamondNorm(Phi - Psi)&lt;br /&gt;
 &lt;br /&gt;
   subject to&lt;br /&gt;
       % these constraints force Phi to be a Pauli channel&lt;br /&gt;
       Phi == PauliChannel(p);&lt;br /&gt;
       sum(p) == 1;&lt;br /&gt;
       p &amp;gt;= 0;&lt;br /&gt;
   cvx_end&lt;br /&gt;
   cvx_optval&lt;br /&gt;
   &lt;br /&gt;
cvx_optval =&lt;br /&gt;
&lt;br /&gt;
    1.5000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=DiamondNorm}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=CBNorm&amp;diff=916</id>
		<title>CBNorm</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=CBNorm&amp;diff=916"/>
		<updated>2018-06-13T16:39:54Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=CBNorm&lt;br /&gt;
|desc=Computes the completely bounded norm of a superoperator&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[DiamondNorm]]&amp;lt;br /&amp;gt;[[InducedSchattenNorm]]&lt;br /&gt;
|cat=[[List of functions#Norms|Norms]]&lt;br /&gt;
|upd=November 21, 2014&lt;br /&gt;
|cvx=yes (convex)}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;CBNorm&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the completely bounded (CB) norm $\|\Phi\|_{cb}$ of a superoperator $\Phi$.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;CB = CBNorm(PHI)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;CB = CBNorm(PHI,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;: A superoperator. Should be provided as either a Choi matrix, or as a cell with either 1 or 2 columns (see the [[tutorial]] page for more details about specifying superoperators within QETLAB).&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, default has input and output spaces of equal dimension): A 1-by-2 vector containing the input and output dimensions of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;, in that order (equivalently, these are the dimensions of the first and second subsystems of the Choi matrix &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;, in that order). If the input or output space is not square, then &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt;&#039;s first row should contain the input and output row dimensions, and its second row should contain its input and output column dimensions. &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; is required if and only if &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; has unequal input and output dimensions and is provided as a Choi matrix.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Relationship with the diamond norm===&lt;br /&gt;
The CB norm of a superoperator $\Phi$ is equal to the diamond norm of the dual map $\Phi^\dagger$:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; Phi = {[1 2;3 4],[0 1;1 0] ; [0 1;2 0],[1 1;1 1] ; [1 1;-1 3],[1 4;0 0]};&lt;br /&gt;
&amp;gt;&amp;gt; CBNorm(Phi)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   19.5928&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; DiamondNorm(DualMap(Phi))&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   19.5928&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Can be used in CVX===&lt;br /&gt;
Just like the &amp;lt;tt&amp;gt;[[DiamondNorm]]&amp;lt;/tt&amp;gt; function, &amp;lt;tt&amp;gt;CBNorm&amp;lt;/tt&amp;gt; is a convex function that can be used within CVX optimization problems. See the [[DiamondNorm#Can_be_used_within_CVX|example on the &amp;lt;tt&amp;gt;DiamondNorm&amp;lt;/tt&amp;gt; documentation page]].&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=CBNorm}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=SkOperatorNorm&amp;diff=915</id>
		<title>SkOperatorNorm</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=SkOperatorNorm&amp;diff=915"/>
		<updated>2018-06-13T16:39:39Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=SkOperatorNorm&lt;br /&gt;
|desc=Computes the S(k)-norm of an operator&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[IsBlockPositive]]&amp;lt;br /&amp;gt;[[SkVectorNorm]]&lt;br /&gt;
|cat=[[List of functions#Norms|Norms]]&lt;br /&gt;
|upd=September 22, 2014&lt;br /&gt;
|cvx=no}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;SkOperatorNorm&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the S(k)-norm of an operator&amp;lt;ref&amp;gt;N. Johnston and D. W. Kribs. A Family of Norms With Applications in Quantum Information Theory. &#039;&#039;J. Math. Phys.&#039;&#039;, 51:082202, 2010. E-print: [http://arxiv.org/abs/0909.3907 arXiv:0909.3907] [quant-ph]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;N. Johnston and D. W. Kribs. A Family of Norms With Applications in Quantum Information Theory II. Quantum Information &amp;amp; Computation, 11(1 &amp;amp; 2):104–123, 2011. E-print: [http://arxiv.org/abs/1006.0898 arXiv:1006.0898] [quant-ph]&amp;lt;/ref&amp;gt;:&lt;br /&gt;
$$&lt;br /&gt;
  \|X\|_{S(k)} := \sup_{|v\rangle , |w\rangle } \Big\{ \big| \langle w| X |v \rangle \big| : SR(|v \rangle), SR(|v \rangle) \leq k, \big\||v \rangle\big\| = \big\||w \rangle\big\| = 1 \Big\},&lt;br /&gt;
$$&lt;br /&gt;
where $SR(\cdot)$ refers to the [[SchmidtRank|Schmidt rank]] of a pure state.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB = SkOperatorNorm(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB = SkOperatorNorm(X,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB = SkOperatorNorm(X,K,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB = SkOperatorNorm(X,K,DIM,STR)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB = SkOperatorNorm(X,K,DIM,STR,TARGET)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB = SkOperatorNorm(X,K,DIM,STR,TARGET,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[LB,~,UB] = SkOperatorNorm(X,K,DIM,STR,TARGET,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[LB,LWIT,UB,UWIT] = SkOperatorNorm(X,K,DIM,STR,TARGET,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: A square matrix acting on bipartite space. Generally, &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; should be positive semidefinite &amp;amp;ndash; the bounds produced otherwise are quite poor.&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default 1): A positive integer.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, by default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the subsystems that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; acts on.&lt;br /&gt;
* &amp;lt;tt&amp;gt;STR&amp;lt;/tt&amp;gt; (optional, default 2): An integer that determines how hard the script should work to compute the lower and upper bounds (&amp;lt;tt&amp;gt;STR = -1&amp;lt;/tt&amp;gt; means that the script won&#039;t stop working until the bounds match each other). Other valid values are &amp;lt;tt&amp;gt;0, 1, 2, 3, ...&amp;lt;/tt&amp;gt;. In practice, if &amp;lt;tt&amp;gt;STR &amp;gt;= 4&amp;lt;/tt&amp;gt; then most computers will run out of memory and/or the sun will explode before computation completes.&lt;br /&gt;
* &amp;lt;tt&amp;gt;TARGET&amp;lt;/tt&amp;gt; (optional, default -1): A value that you wish to prove that the norm is above or below. If, at any point while this script is running, it proves that &amp;lt;tt&amp;gt;LB &amp;gt;= TARGET&amp;lt;/tt&amp;gt; or that &amp;lt;tt&amp;gt;UB &amp;lt;= TARGET&amp;lt;/tt&amp;gt;, then the script will immediately abort and return the best lower bound and upper bound computed up to that point. This is a time-saving feature that can be avoided by setting &amp;lt;tt&amp;gt;TARGET = -1&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;eps^(3/8)&amp;lt;/tt&amp;gt;): The numerical tolerance used throughout the script.&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;LB&amp;lt;/tt&amp;gt;: A lower bound of the S(k)-operator norm of &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;LWIT&amp;lt;/tt&amp;gt;: A witness that verifies that &amp;lt;tt&amp;gt;LB&amp;lt;/tt&amp;gt; is indeed a lower bound of the S(k)-operator norm of &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;. More specifically, &amp;lt;tt&amp;gt;LWIT&amp;lt;/tt&amp;gt; is a unit vector such that &amp;lt;tt&amp;gt;SchmidtRank(LWIT,DIM) &amp;lt;= K&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;LWIT&#039;*X*LWIT = LB&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;UB&amp;lt;/tt&amp;gt;: An upper bound of the S(k)-operator norm of &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;UWIT&amp;lt;/tt&amp;gt;: A witness that verifies that &amp;lt;tt&amp;gt;UB&amp;lt;/tt&amp;gt; is indeed an upper bound of the S(k)-operator norm of &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;. More specifically, &amp;lt;tt&amp;gt;UWIT&amp;lt;/tt&amp;gt; is a feasible point of the dual semidefinite program presented in Section&amp;amp;nbsp;5.2.3 of &amp;lt;ref name=&amp;quot;nj_thesis&amp;quot;&amp;gt;N. Johnston. Norms and Cones in the Theory of Quantum Entanglement. PhD thesis, University of Guelph, 2012. E-print: [http://arxiv.org/abs/1207.1479 arXiv:1207.1479] [quant-ph]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Exact computation in small dimensions===&lt;br /&gt;
When &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; lives in $M_2 \otimes M_2$, $M_2 \otimes M_3$, or $M_3 \otimes M_2$ (i.e., when &amp;lt;tt&amp;gt;prod(DIM) &amp;lt;= 6&amp;lt;/tt&amp;gt;), the script is guaranteed to compute the exact value of $\|X\|_{S(1)}$:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; X = [5 1 1 1;1 1 1 1;1 1 1 1;1 1 1 1]/8;&lt;br /&gt;
&amp;gt;&amp;gt; SkOperatorNorm(X)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7286&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fact that this computation is correct is illustrated in Example 5.2.11 of &amp;lt;ref name=&amp;quot;nj_thesis&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;, where it was shown that the S(1)-norm is exactly $(3 + 2\sqrt{2})/8 \approx 0.7286$. However, if we were still unconvinced, we could request witnesses that verify that 0.7286 is both a lower bound and an upper bound of the S(1)-norm:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; [lb,lwit,ub,uwit] = SkOperatorNorm(X)&lt;br /&gt;
&lt;br /&gt;
lb =&lt;br /&gt;
&lt;br /&gt;
    0.7286&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
lwit =&lt;br /&gt;
&lt;br /&gt;
   0.8536 + 0.0000i&lt;br /&gt;
   0.3536 - 0.0000i&lt;br /&gt;
   0.3536 + 0.0000i&lt;br /&gt;
   0.1464          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ub =&lt;br /&gt;
&lt;br /&gt;
    0.7286&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
uwit =&lt;br /&gt;
&lt;br /&gt;
   0.0518 + 0.0000i  -0.0625 + 0.0000i  -0.0625 - 0.0000i  -0.1250 - 0.0000i&lt;br /&gt;
  -0.0625 - 0.0000i   0.3018 + 0.0000i   0.0000 + 0.0000i  -0.0625 - 0.0000i&lt;br /&gt;
  -0.0625 + 0.0000i   0.0000 - 0.0000i   0.3018 + 0.0000i  -0.0625 + 0.0000i&lt;br /&gt;
  -0.1250 + 0.0000i  -0.0625 + 0.0000i  -0.0625 - 0.0000i   0.3018 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; lwit&#039;*X*lwit % verify that the lower bound is correct&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.7286 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; norm(X + uwit) % verify that the upper bound is correct&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7286&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Only interested in the lower and upper bounds; not the witnesses===&lt;br /&gt;
If all you want are the lower and upper bounds, but don&#039;t require the witnesses &amp;lt;tt&amp;gt;LWIT&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;UWIT&amp;lt;/tt&amp;gt;, you can use code like the following. Note that in this case, $\|X\|_{S(1)}$ is computed exactly, as the lower and upper bound are equal (though this will not happen for all &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;!). However, all we know about $\|X\|_{S(2)}$ is that it lies in the interval [0.3522, 0.3546]. It is unsurprising that $\|X\|_{S(3)}$ is the usual operator norm of &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;, since this is always the case when &amp;lt;tt&amp;gt;K &amp;gt;= min(DIM)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; X = RandomDensityMatrix(9);&lt;br /&gt;
&amp;gt;&amp;gt; [lb,~,ub] = SkOperatorNorm(X,1)&lt;br /&gt;
&lt;br /&gt;
lb =&lt;br /&gt;
&lt;br /&gt;
    0.2955&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ub =&lt;br /&gt;
&lt;br /&gt;
    0.2955&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; [lb,~,ub] = SkOperatorNorm(X,2)&lt;br /&gt;
&lt;br /&gt;
lb =&lt;br /&gt;
&lt;br /&gt;
    0.3522&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ub =&lt;br /&gt;
&lt;br /&gt;
    0.3546&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; [lb,~,ub] = SkOperatorNorm(X,3)&lt;br /&gt;
&lt;br /&gt;
lb =&lt;br /&gt;
&lt;br /&gt;
    0.3770&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ub =&lt;br /&gt;
&lt;br /&gt;
    0.3770&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; norm(X)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.3770&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=SkOperatorNorm}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=XORGameValue&amp;diff=914</id>
		<title>XORGameValue</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=XORGameValue&amp;diff=914"/>
		<updated>2018-06-13T16:39:01Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=XORGameValue&lt;br /&gt;
|desc=Computes the classical or quantum value of a nonlocal binary XOR game&lt;br /&gt;
|rel=[[BCSGameValue]]&amp;lt;br /&amp;gt;[[BellInequalityMax]]&amp;lt;br /&amp;gt;[[NonlocalGameValue]]&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|cat=[[List of functions#Nonlocality_and_Bell_inequalities|Nonlocality and Bell inequalities]]&lt;br /&gt;
|upd=January 15, 2015}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;XORGameValue&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the classical or quantum value of a nonlocal binary XOR game. That is, it computes the optimal probability of two parties (Alice and Bob) winning such a game, assuming that they can communicate before the game, but not during the game, and either (1) they cannot share entanglement, or (2) they can share entanglement.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;VAL = XORGameValue(P,F)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;VAL = XORGameValue(P,F,VTYPE)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt;: A matrix whose (s,t)-entry gives the probability that the referee will give Alice the value s and Bob the value t. The sum of all entries of this matrix must be 1.&lt;br /&gt;
* &amp;lt;tt&amp;gt;F&amp;lt;/tt&amp;gt;: A binary matrix (of the same size as &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt;) whose (s,t)-entry indicates the winning choice (either 0 or 1) when Alice and Bob receive values s and t from the referee.&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTYPE&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;): One of &#039;classical&#039; or &#039;quantum&#039;, indicating whether or not Alice and Bob can use quantum strategies (i.e., shared entanglement).&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===The CHSH game===&lt;br /&gt;
The CHSH game&amp;lt;ref&amp;gt;John Watrous. [https://cs.uwaterloo.ca/~watrous/CPSC519/LectureNotes/20.pdf Lecture 20: Bell inequalities and nonlocality], &#039;&#039;Quantum Computation Lecture Notes&#039;&#039;, 2006.&amp;lt;/ref&amp;gt; is a game in which the referee (uniformly at random) gives each of Alice and Bob a single bit, and Alice and Bob win if the XOR of their responses is the AND of the bits received by the referee. That is, Alice and Bob want the XOR of their responses to be 1 if and only if they both received a 1 from the referee.&lt;br /&gt;
&lt;br /&gt;
It is well-known that the maximum probability of winning this game if Alice and Bob share entanglement is $\cos^2(\pi/8)$, whereas the maximum probability of winning this game without entanglement is $3/4$. The following code demonstrates this fact: the &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; matrix has each entry &amp;lt;tt&amp;gt;1/4&amp;lt;/tt&amp;gt; because each of the 4 possible combinations of bits from the referee are equally likely, and the matrix &amp;lt;tt&amp;gt;f&amp;lt;/tt&amp;gt; equals &amp;lt;tt&amp;gt;[0 0;0 1]&amp;lt;/tt&amp;gt; because Alice and Bob want the XOR of their answers to be 1 only when they both receive a 1 from the referee (the first row of the matrix corresponds to Alice receiving a 0, the second row of the matrix corresponds to Alice receiving a 1, and the columns are similar for Bob).&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = [1/4 1/4;1/4 1/4];&lt;br /&gt;
&amp;gt;&amp;gt; f = [0 0;0 1];&lt;br /&gt;
&amp;gt;&amp;gt; XORGameValue(p,f,&#039;quantum&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.8536&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; cos(pi/8)^2 % compare the answer to the known theoretical answer&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.8536&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; XORGameValue(p,f,&#039;classical&#039;) % compare to the classical value of this game&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The odd cycles game===&lt;br /&gt;
The odd cycles game&amp;lt;ref&amp;gt;R. Cleve, P. Hoyer, B. Toner, and J. Watrous. Consequences and limits of nonlocal strategies. In &#039;&#039;Proceedings of 19th IEEE Conference on Computational Complexity (CCC 2004)&#039;&#039;. E-print: [http://arxiv.org/abs/quant-ph/0404076 arXiv:quant-ph/0404076]&amp;lt;/ref&amp;gt; is a game where Alice and Bob try to convince the referee that an cycle of length n has a 2-coloring, which is impossible when n is odd. The referee gives each of Alice and Bob a number from 1 to n (representing the n different vertices of the n-cycle), and Alice and Bob respond with a color (0 or 1). They win the game if either (1) the referee gave Alice and Bob the same number and Alice and Bob&#039;s responses are the same; or (2) the referee gave Alice and Bob numbers that differ by 1 (corresponding to adjacent vertices) and Alice and Bob&#039;s responses are different. Otherwise, they lose the game.&lt;br /&gt;
&lt;br /&gt;
If $n$ is odd, it is known that the maximum probability of winning this game with shared entanglement is $\cos^2(\pi/4n)$, whereas the maximum probability of winning this game without entanglement is $1 - 1/(2n)$. These facts are verified by the following code when $n = 5$:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; n = 5;&lt;br /&gt;
&amp;gt;&amp;gt; % first compute the probability matrix (see the cited paper for details)&lt;br /&gt;
&amp;gt;&amp;gt; p = diag(ones(1,n))/(2*n) + circshift(diag(ones(1,n)),-1)/(2*n)&lt;br /&gt;
&lt;br /&gt;
p =&lt;br /&gt;
&lt;br /&gt;
    0.1000    0.1000         0         0         0&lt;br /&gt;
         0    0.1000    0.1000         0         0&lt;br /&gt;
         0         0    0.1000    0.1000         0&lt;br /&gt;
         0         0         0    0.1000    0.1000&lt;br /&gt;
    0.1000         0         0         0    0.1000&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; % now we specify the winning condition matrix&lt;br /&gt;
&amp;gt;&amp;gt; f = circshift(diag(ones(1,n)),-1)&lt;br /&gt;
&lt;br /&gt;
f =&lt;br /&gt;
&lt;br /&gt;
     0     1     0     0     0&lt;br /&gt;
     0     0     1     0     0&lt;br /&gt;
     0     0     0     1     0&lt;br /&gt;
     0     0     0     0     1&lt;br /&gt;
     1     0     0     0     0&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; XORGameValue(p,f,&#039;quantum&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.9755&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; cos(pi/(4*n))^2 % compare the answer to the known theoretical answer&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.9755&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; XORGameValue(p,f,&#039;classical&#039;) % compare to the classical value of this game&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.9000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=XORGameValue}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=NonlocalGameValue&amp;diff=913</id>
		<title>NonlocalGameValue</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=NonlocalGameValue&amp;diff=913"/>
		<updated>2018-06-13T16:38:43Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=NonlocalGameValue&lt;br /&gt;
|desc=Computes the maximum value of a two-player non-local game&lt;br /&gt;
|rel=[[BCSGameValue]]&amp;lt;br /&amp;gt;[[BellInequalityMax]]&amp;lt;br /&amp;gt;[[NPAHierarchy]]&amp;lt;br /&amp;gt;[[XORGameValue]]&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|cat=[[List of functions#Nonlocality_and_Bell_inequalities|Nonlocality and Bell inequalities]]&lt;br /&gt;
|upd=March 6, 2015&lt;br /&gt;
|cvx=no}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;NonlocalGameValue&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the maximum possible value of a given non-local game under either classical mechanics, quantum mechanics, or general no-signalling theories. In the classical and non-signalling cases, an exact value is computed, whereas the value computed in the quantum case is only an upper bound (found using the [[NPAHierarchy|NPA hierarchy]]).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;NGVAL = NonlocalGameValue(P,V)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;NGVAL = NonlocalGameValue(P,V,MTYPE)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;NGVAL = NonlocalGameValue(P,V,MTYPE,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt;: A probability matrix whose $(x,y)$-entry gives the probability that the referee asks Alice question $x$ and Bob question $y$.&lt;br /&gt;
* &amp;lt;tt&amp;gt;V&amp;lt;/tt&amp;gt;: A 4-D array whose $(a,b,x,y)$-entry gives the value awarded to Alice and Bob if they reply with answers $(a,b)$ to questions $(x,y)$.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MTYPE&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;): A string indicating which type of theory should be used when computing the maximum value of the non-local game. Must be one of &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&#039;quantum&#039;&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;&#039;nosignal&#039;&amp;lt;/tt&amp;gt;. If &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt; then only an upper bound on the non-local game is computed, not necessarily the &#039;&#039;best&#039;&#039; upper bound (see the argument &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; below).&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;): If &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt; then this is a non-negative integer indicating what level of the NPA hierarchy should be used when bounding the value of the non-local game. Higher values of &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; give better bounds, but require more memory and time. Alternatively, &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; can be a string of a form like &amp;lt;tt&amp;gt;&#039;1+ab+aab&#039;&amp;lt;/tt&amp;gt;, which indicates that an intermediate level of the hierarchy should be used, where this example uses all products of 1 measurement, all products of one Alice and one Bob measurement, and all products of two Alice and one Bob measurement. Use plus signs to separate the different categories of products, as above. The first character of this string should always be a number, indicating the base level to use. If &amp;lt;tt&amp;gt;MTYPE&amp;lt;/tt&amp;gt; is anything other than &amp;lt;tt&amp;gt;&#039;quantum&#039;&amp;lt;/tt&amp;gt; then &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===The CHSH inequality===&lt;br /&gt;
One formulation of the [http://en.wikipedia.org/wiki/CHSH_inequality CHSH inequality]&amp;lt;ref&amp;gt;J.F. Clauser, M.A. Horne, A. Shimony, R.A. Holt. Proposed experiment to test local hidden-variable theories. &amp;lt;em&amp;gt;Phys. Rev. Lett.&amp;lt;/em&amp;gt;, 23(15):880&amp;amp;ndash;884, 1969.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
* A referee asks Alice a question $x \in \{0,1\}$ and Bob a question $y \in \{0,1\}$.&lt;br /&gt;
* Alice and Bob then reply with answers $a \in \{0,1\}$ and $b \in \{0,1\}$ respectively.&lt;br /&gt;
* Alice and Bob win if and only if $a \oplus b = xy$.&lt;br /&gt;
The optimal probability with which Alice and Bob can win this game in classical, quantum, and no-signalling theories are as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; d = 2;&lt;br /&gt;
&amp;gt;&amp;gt; p = ones(d,d)/d^2;&lt;br /&gt;
&amp;gt;&amp;gt; V = zeros(d,d,d,d);&lt;br /&gt;
&amp;gt;&amp;gt; for a = 1:d&lt;br /&gt;
     for b = 1:d&lt;br /&gt;
       for x = 1:d&lt;br /&gt;
         for y = 1:d&lt;br /&gt;
           if(mod(a+b+x*y,d)==0)&lt;br /&gt;
             V(a,b,x,y) = 1;&lt;br /&gt;
           end&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7500&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;quantum&#039;,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.8536&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;nosignal&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    1.0000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The CHSH-d inequality===&lt;br /&gt;
A generalization of the CHSH inequality to higher dimensions is exactly as above, except each of $a,b,x,y$ are taken from the set $\{0,1,\ldots,d-1\}$.&amp;lt;ref&amp;gt;M. Howard. Maximum nonlocality and minimum uncertainty using magic states. E-print: [http://arxiv.org/abs/1501.05319 arXiv:arXiv:1501.05319] [quant-ph], 2015.&amp;lt;/ref&amp;gt; The following code computes the values of the CHSH-3 game:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; d = 3;&lt;br /&gt;
&amp;gt;&amp;gt; p = ones(d,d)/d^2;&lt;br /&gt;
&amp;gt;&amp;gt; V = zeros(d,d,d,d);&lt;br /&gt;
&amp;gt;&amp;gt; for a = 1:d&lt;br /&gt;
     for b = 1:d&lt;br /&gt;
       for x = 1:d&lt;br /&gt;
         for y = 1:d&lt;br /&gt;
           if(mod(a+b+x*y,d)==0)&lt;br /&gt;
             V(a,b,x,y) = 1;&lt;br /&gt;
           end&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.6667&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;quantum&#039;,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7182&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;quantum&#039;,2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7182&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;quantum&#039;,&#039;2+aab&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7124&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;nosignal&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    1.0000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The Fortnow-Feige-Lovász game===&lt;br /&gt;
The Fortnow-Feige-Lovász (FFL) game&amp;lt;ref&amp;gt;U. Feige, L. Lovász, In Proceedings of the 24th ACM STOC, pages 733-744, 1992.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;L. Fortnow, PhD thesis, Massachusetts Institute of Technology, Technical Report MIT/LCS/TR-447, May 1989.&amp;lt;/ref&amp;gt; is well-known example of a non-local game for which perfect parallel repetition does not hold (i.e., quantum players playing two copies of the game in parallel can do better than they can by playing the games in succession).&lt;br /&gt;
&lt;br /&gt;
The game has binary inputs and outputs, and is defined by the rule that the referee asks Alice and Bob the question pair $(x,y) = (0,0)$, $(0,1)$, or $(1,0)$ with probability $1/3$ each, and Alice and Bob win if and only if their answers satisfy $x \vee a \neq y \vee b$, where $\vee$ denotes the bitwise OR operation.&lt;br /&gt;
&lt;br /&gt;
It is known that both the classical value and quantum value of this game equal $2/3$, which we can verify as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = [1 1;1 0]/3;&lt;br /&gt;
&amp;gt;&amp;gt; V = zeros(2,2,2,2);&lt;br /&gt;
&amp;gt;&amp;gt; for a = 1:2&lt;br /&gt;
       for b = 1:2&lt;br /&gt;
           for x = 1:2&lt;br /&gt;
               for y = 1:2&lt;br /&gt;
                   if(max(x,a) ~= max(y,b))&lt;br /&gt;
                       V(a,b,x,y) = 1;&lt;br /&gt;
                   end&lt;br /&gt;
               end&lt;br /&gt;
           end&lt;br /&gt;
       end&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.6667&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;quantum&#039;,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.6667&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Parallel repetition====&lt;br /&gt;
In fact, we can even compute the classical and quantum values of two copies of the FFL game being run in parallel: we simply specify the &amp;lt;tt&amp;gt;REPT&amp;lt;/tt&amp;gt; input argument to be 2:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;classical&#039;,1,2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.6667&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; NonlocalGameValue(p,V,&#039;quantum&#039;,1,2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.6667&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Indeed, the fact that both of these values also equal $2/3$ is a known fact &amp;lt;ref&amp;gt;R. Cleve, W. Slofstra, F. Unger, and S. Upadhyay. Perfect parallel repetition theorem for quantum XOR proof systems. &#039;&#039;Computational Complexity&#039;&#039;, 17:282&amp;amp;ndash;299, 2008. E-print: [http://arxiv.org/abs/quant-ph/0608146 arXiv:quant-ph/0608146]&amp;lt;/ref&amp;gt;. Note that in the command &amp;lt;tt&amp;gt;NonlocalGameValue(p,V,&#039;classical&#039;,1,2)&amp;lt;/tt&amp;gt;, the &amp;quot;1&amp;quot; that is provided as the value of &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; does not do anything: it is simply provided as a placeholder so that we can set &amp;lt;tt&amp;gt;REPT = 2&amp;lt;/tt&amp;gt; in the next input argument (e.g., we could have just as well entered the command &amp;lt;tt&amp;gt;NonlocalGameValue(p,V,&#039;classical&#039;,9873,2)&amp;lt;/tt&amp;gt;, and the same calculation would have been carried out).&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=NonlocalGameValue}}&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
In practice, &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; probably can&#039;t be any larger than 4 when &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt;, due to memory and time restrictions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=BellInequalityMaxQubits&amp;diff=912</id>
		<title>BellInequalityMaxQubits</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=BellInequalityMaxQubits&amp;diff=912"/>
		<updated>2018-06-13T16:38:29Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=BellInequalityMaxQubits&lt;br /&gt;
|desc=Approximates the optimal value of a Bell inequality in qubit (i.e., 2-dimensional quantum) settings&lt;br /&gt;
|rel=[[BellInequalityMax]]&amp;lt;br /&amp;gt;[[NonlocalGameValue]]&amp;lt;br /&amp;gt;[[XORGameValue]]&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|cat=[[List of functions#Nonlocality_and_Bell_inequalities|Nonlocality and Bell inequalities]]&lt;br /&gt;
|cvx=no}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;BellInequalityMaxQubits&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes an upper bound for the maximum possible value of a given [http://en.wikipedia.org/wiki/Bell%27s_theorem Bell inequality] in a quantum mechanical setting where the two parties each have access to qubits (i.e., 2-dimensional quantum systems). This bound is computed using the method presented in &amp;lt;ref name=&amp;quot;NTV14&amp;quot;&amp;gt;M. Navascués, G. de la Torre, and T. Vértesi. Characterization of quantum correlations with local dimension constraints and its device-independent applications. &amp;lt;em&amp;gt;Phys. Rev. X&amp;lt;/em&amp;gt;, 4:011011, 2014. E-print: [http://arxiv.org/abs/1308.3410 arXiv:1308.3410] [quant-ph]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BMAX = BellInequalityMaxQubits(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[BMAX,RHO] = BellInequalityMaxQubits(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;JOINT_COE&amp;lt;/tt&amp;gt;: A matrix whose $(i,j)$-entry gives the coefficient of $\langle A_i B_j \rangle$ in the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;A_COE&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the coefficient of $\langle A_i \rangle$ in the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;B_COE&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the coefficient of $\langle B_i \rangle$ in the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;A_VAL&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Alice&#039;s side.&lt;br /&gt;
* &amp;lt;tt&amp;gt;B_VAL&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Bob&#039;s side.&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;BMAX&amp;lt;/tt&amp;gt;: An upper bound on the qubit value of the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt;: A many-qubit quantum state that acts as a witness that verifies the bound provided by &amp;lt;tt&amp;gt;BMAX&amp;lt;/tt&amp;gt;. This is the positive-partial-transpose (PPT) state described by &amp;lt;ref name=&amp;quot;NTV14&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===The I&amp;lt;sub&amp;gt;3322&amp;lt;/sub&amp;gt; inequality===&lt;br /&gt;
The I&amp;lt;sub&amp;gt;3322&amp;lt;/sub&amp;gt; inequality&amp;lt;ref&amp;gt;M. Froissart. Constructive generalization of Bell&#039;s inequalities. &amp;lt;em&amp;gt;Nuov. Cim. B&amp;lt;/em&amp;gt;, 64:241, 1981&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;D. Collins and N. Gisin. A relevant two qubit Bell inequality inequivalent to the CHSH inequality. J. Phys. A: Math. Gen., 37(5):1175, 2004. E-print: [http://arxiv.org/abs/quant-ph/0306129 arXiv:quant-ph/0306129]&amp;lt;/ref&amp;gt; is a Bell inequality that says that if $\{A_1,A_2,A_3\}$ and $\{B_1,B_2,B_3\}$ are $\{0,1\}$-valued measurement settings, then in classical physics the following inequality holds:&lt;br /&gt;
: &amp;lt;math&amp;gt;\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle - \langle A_1 B_3 \rangle + \langle A_2 B_1 \rangle + \langle A_2 B_2 \rangle + \langle A_2 B_3 \rangle - \langle A_3 B_1 \rangle + \langle A_3 B_2 \rangle - \langle A_2 \rangle - \langle B_1 \rangle - 2\langle B_2 \rangle \leq 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
It is straightforward to check that a 2-qubit maximally-entangled Bell state allows for a value of $1/4$ in this Bell inequality. The following code verifies that it is not possible to get a value of larger than $1/4$ using $2$-dimensional systems:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMaxQubits([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1])&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.2500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is worth taking a look at the $I_{3322}$ example at the &amp;lt;tt&amp;gt;[[BellInequalityMax]]&amp;lt;/tt&amp;gt; page to compare the computations provided there.&lt;br /&gt;
{{SourceCode|name=BellInequalityMaxQubits}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=BellInequalityMax&amp;diff=911</id>
		<title>BellInequalityMax</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=BellInequalityMax&amp;diff=911"/>
		<updated>2018-06-13T16:38:14Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=BellInequalityMax&lt;br /&gt;
|desc=Computes the maximum value of a Bell inequality&lt;br /&gt;
|rel=[[NonlocalGameValue]]&amp;lt;br /&amp;gt;[[NPAHierarchy]]&amp;lt;br /&amp;gt;[[XORGameValue]]&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|cat=[[List of functions#Nonlocality_and_Bell_inequalities|Nonlocality and Bell inequalities]]&lt;br /&gt;
|upd=January 22, 2015&lt;br /&gt;
|cvx=no}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;BellInequalityMax&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the maximum possible value of a given [http://en.wikipedia.org/wiki/Bell%27s_theorem Bell inequality] under either classical mechanics, quantum mechanics, or general no-signalling theories. In the classical and non-signalling cases, an exact value is computed, whereas the value computed in the quantum case is only an upper bound (found using the [[NPAHierarchy|NPA hierarchy]]).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BMAX = BellInequalityMax(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;BMAX = BellInequalityMax(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL,MTYPE)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;BMAX = BellInequalityMax(JOINT_COE,A_COE,B_COE,A_VAL,B_VAL,MTYPE,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;JOINT_COE&amp;lt;/tt&amp;gt;: A matrix whose $(i,j)$-entry gives the coefficient of $\langle A_i B_j \rangle$ in the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;A_COE&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the coefficient of $\langle A_i \rangle$ in the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;B_COE&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the coefficient of $\langle B_i \rangle$ in the Bell inequality.&lt;br /&gt;
* &amp;lt;tt&amp;gt;A_VAL&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Alice&#039;s side.&lt;br /&gt;
* &amp;lt;tt&amp;gt;B_VAL&amp;lt;/tt&amp;gt;: A vector whose $i$-th entry gives the value of the $i$-th measurement result on Bob&#039;s side.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MTYPE&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;): A string indicating which type of theory should be used when computing the maximum value of the Bell inequality. Must be one of &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&#039;quantum&#039;&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;&#039;nosignal&#039;&amp;lt;/tt&amp;gt;. If &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt; then only an upper bound on the Bell inequality is computed, not necessarily is &amp;lt;em&amp;gt;best&amp;lt;/em&amp;gt; upper bound (see the argument &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; below).&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;): If &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt; then this is a non-negative integer indicating what level of the NPA hierarchy should be used when bounding the Bell inequality. Higher values of &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; give better bounds, but require more memory and time. Alternatively, &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; can be a string of a form like &amp;lt;tt&amp;gt;&#039;1+ab+aab&#039;&amp;lt;/tt&amp;gt;, which indicates that an intermediate level of the hierarchy should be used, where this example uses all products of 1 measurement, all products of one Alice and one Bob measurement, and all products of two Alice and one Bob measurement. Use plus signs to separate the different categories of products, as above. The first character of this string should always be a number, indicating the base level to use. If &amp;lt;tt&amp;gt;MTYPE&amp;lt;/tt&amp;gt; is anything other than &amp;lt;tt&amp;gt;&#039;quantum&#039;&amp;lt;/tt&amp;gt; then &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===The CHSH inequality===&lt;br /&gt;
One formulation of the [http://en.wikipedia.org/wiki/CHSH_inequality CHSH inequality]&amp;lt;ref&amp;gt;J.F. Clauser, M.A. Horne, A. Shimony, R.A. Holt. Proposed experiment to test local hidden-variable theories. &amp;lt;em&amp;gt;Phys. Rev. Lett.&amp;lt;/em&amp;gt;, 23(15):880&amp;amp;ndash;884, 1969.&amp;lt;/ref&amp;gt; says that if $\{A_1,A_2\}$ and $\{B_1,B_2\}$ are $\{-1,+1\}$-valued measurement settings, then in classical physics the following inequality holds:&lt;br /&gt;
: &amp;lt;math&amp;gt;\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle + \langle A_2 B_1 \rangle - \langle A_2 B_2 \rangle \leq 2.&amp;lt;/math&amp;gt;&lt;br /&gt;
Similarly, the best bound on this quantity is $2\sqrt{2}$ in a quantum mechanical setting (this is [http://en.wikipedia.org/wiki/Tsirelson%27s_bound Tsirelson&#039;s bound])&amp;lt;ref&amp;gt;B.S. Tsirelson. Quantum generalizations of Bell&#039;s inequality. &amp;lt;em&amp;gt;Lett. Math. Phys.&amp;lt;/em&amp;gt;, 4:93, 1980. [http://www.tau.ac.il/~tsirel/download/qbell80.pdf E-print]&amp;lt;/ref&amp;gt;, and it is $4$ in no-signalling theories. All three of these bounds can be found as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1;1 -1], [0 0], [0 0], [-1 1], [-1 1], &#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     2&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1;1 -1], [0 0], [0 0], [-1 1], [-1 1], &#039;quantum&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    2.8284&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1;1 -1], [0 0], [0 0], [-1 1], [-1 1], &#039;nosignal&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    4.0000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The CHSH inequality again===&lt;br /&gt;
Another (equivalent) formulation of the CHSH inequality says that if $\{A_1,A_2\}$ and $\{B_1,B_2\}$ are $\{0,1\}$-valued measurement settings, then in classical physics the following inequality holds:&lt;br /&gt;
: &amp;lt;math&amp;gt;\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle + \langle A_2 B_1 \rangle - \langle A_2 B_2 \rangle - \langle A_1 \rangle - \langle B_1 \rangle \leq 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
Similarly, the best bound on this quantity is $1/\sqrt{2} - 1/2$ in a quantum mechanical setting, and it is $1/2$ in no-signalling settings. These three bounds can be verified as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1;1 -1], [-1 0], [-1 0], [0 1], [0 1], &#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1;1 -1], [-1 0], [-1 0], [0 1], [0 1], &#039;quantum&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.2071&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1;1 -1], [-1 0], [-1 0], [0 1], [0 1], &#039;nosignal&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.5000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The I&amp;lt;sub&amp;gt;3322&amp;lt;/sub&amp;gt; inequality===&lt;br /&gt;
The I&amp;lt;sub&amp;gt;3322&amp;lt;/sub&amp;gt; inequality&amp;lt;ref&amp;gt;M. Froissart. Constructive generalization of Bell&#039;s inequalities. &amp;lt;em&amp;gt;Nuov. Cim. B&amp;lt;/em&amp;gt;, 64:241, 1981&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;D. Collins and N. Gisin. A relevant two qubit Bell inequality inequivalent to the CHSH inequality. J. Phys. A: Math. Gen., 37(5):1175, 2004. E-print: [http://arxiv.org/abs/quant-ph/0306129 arXiv:quant-ph/0306129]&amp;lt;/ref&amp;gt; is a Bell inequality that says that if $\{A_1,A_2,A_3\}$ and $\{B_1,B_2,B_3\}$ are $\{0,1\}$-valued measurement settings, then in classical physics the following inequality holds:&lt;br /&gt;
: &amp;lt;math&amp;gt;\langle A_1 B_1 \rangle + \langle A_1 B_2 \rangle - \langle A_1 B_3 \rangle + \langle A_2 B_1 \rangle + \langle A_2 B_2 \rangle + \langle A_2 B_3 \rangle - \langle A_3 B_1 \rangle + \langle A_3 B_2 \rangle - \langle A_2 \rangle - \langle B_1 \rangle - 2\langle B_2 \rangle \leq 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
Similarly, it is known that a value of (strictly) larger than $1/4$ is possible in quantum mechanics&amp;lt;ref name=&amp;quot;palvertes&amp;quot;&amp;gt;K.F. Pál and T. Vértesi. Maximal violation of a bipartite three-setting, two-outcome Bell inequality using infinite-dimensional quantum systems. &amp;lt;em&amp;gt;Phys. Rev. A&amp;lt;/em&amp;gt;, 82:022116, 2010. E-print: [http://arxiv.org/abs/1006.3032 arXiv:1006.3032] [quant-ph]&amp;lt;/ref&amp;gt;, and the best possible bound is $1$ in no-signalling theories. The following code computes the best possible classical and no-signalling bounds exactly, and computes several different upper bounds for the quantum mechanical setting:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;quantum&#039;, 1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.366025403693998&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;quantum&#039;, &#039;1+ab&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.251470897708374 % as we increase K, the upper bound gets lower (better)&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;quantum&#039;, 2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.250939721548844&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;quantum&#039;, 3)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.250875554481214&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;quantum&#039;, 4)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.250875378885565&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BellInequalityMax([1 1 -1;1 1 1;-1 1 0], [0 -1 0], [-1 -2 0], [0 1], [0 1], &#039;nosignal&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.999999991391596&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We note that the values provided for the quantum upper bound above for &amp;lt;tt&amp;gt;K = &#039;1+ab&#039;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;K = 2&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;K = 3&amp;lt;/tt&amp;gt; agree with the values found in &amp;lt;ref name=&amp;quot;npa2&amp;quot;&amp;gt;M. Navascués, S. Pironio, and A. Acín. A convergent hierarchy of semidefinite programs characterizing the set of quantum correlations. &#039;&#039; New J. Phys.&#039;&#039;, 10:073013, 2008. E-print: [http://arxiv.org/abs/0803.4290 arXiv:0803.4290] [quant-ph]&amp;lt;/ref&amp;gt;. Furthermore, the value when &amp;lt;tt&amp;gt;K = 4&amp;lt;/tt&amp;gt; agrees with the value found in &amp;lt;ref name=&amp;quot;palvertes&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;. The exact value of the best upper bound in the quantum setting is an open problem, but is known to be approximately $0.250875$.&lt;br /&gt;
{{SourceCode|name=BellInequalityMax}}&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
In practice, &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; probably can&#039;t be any larger than 4 when &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=BCSGameValue&amp;diff=910</id>
		<title>BCSGameValue</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=BCSGameValue&amp;diff=910"/>
		<updated>2018-06-13T16:37:55Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=BCSGameValue&lt;br /&gt;
|desc=Computes the maximum value of a binary constraint system (BCS) game&lt;br /&gt;
|rel=[[BellInequalityMax]]&amp;lt;br /&amp;gt;[[NonlocalGameValue]]&amp;lt;br /&amp;gt;[[XORGameValue]]&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|cat=[[List of functions#Nonlocality_and_Bell_inequalities|Nonlocality and Bell inequalities]]&lt;br /&gt;
|upd=June 23, 2015&lt;br /&gt;
|cvx=no}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;BCSGameValue&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the maximum possible value of a given binary constraint system (BCS) game&amp;lt;ref name=&amp;quot;CM14&amp;quot;&amp;gt;R. Cleve and R. Mittal. Characterization of binary constraint system games. Lecture Notes in Computer Science, 8572:320&amp;amp;ndash;331, 2014. E-print: [http://arxiv.org/abs/1209.2729 arXiv:1209.2729] [quant-ph]&amp;lt;/ref&amp;gt; under either classical mechanics, quantum mechanics, or general no-signalling theories. In the classical and non-signalling cases, an exact value is computed, whereas the value computed in the quantum case is only an upper bound (found using the [[NPAHierarchy|NPA hierarchy]]).&lt;br /&gt;
&lt;br /&gt;
A binary constraint system game is a [[NonlocalGameValue|non-local game]] in which there is a finite set of variables $v_1, v_2, \ldots, v_k$ and a finite set of constraints placed on those variables:&lt;br /&gt;
$$&lt;br /&gt;
f_1(v_1,v_2,\ldots,v_k) = 1 \quad \quad f_2(v_1,v_2,\ldots,v_k) = 1 \quad \cdots \quad f_m(v_1,v_2,\ldots,v_k) = 1.&lt;br /&gt;
$$&lt;br /&gt;
One of the constraints $f_i$ is chosen (at random, with equal probability) and given to Alice, and one of the variables $v_j$ appearing in $f_i$ is chosen (at random, with equal probability) and given to Bob. Alice and Bob win the game if and only if (1) Alice returns an assignment for every variable that satisfies her constraint, and (2) Bob returns a value for his variable that agrees with the value that Alice chose for that particular variable.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BCSVAL = BCSGameValue(C)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;BCSVAL = BCSGameValue(C,MTYPE)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;BCSVAL = BCSGameValue(C,MTYPE,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt;: A cell, each of whose elements is a constraint in the BCS. The constraints themselves are specified as $2 \times 2 \times 2 \times \cdots$ binary arrays, where the $(i,j,k,\ldots)$-entry is 1 if and only if setting $v_1=i, v_2=j, v_3=k, \ldots$ satisfies that constraint.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MTYPE&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;): A string indicating which type of theory should be used when computing the maximum value of the BCS game. Must be one of &amp;lt;tt&amp;gt;&#039;classical&#039;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&#039;quantum&#039;&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;&#039;nosignal&#039;&amp;lt;/tt&amp;gt;. If &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt; then only an upper bound on the non-local game is computed, not necessarily the &#039;&#039;best&#039;&#039; upper bound (see the argument &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; below).&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;): If &amp;lt;tt&amp;gt;MTYPE = &#039;quantum&#039;&amp;lt;/tt&amp;gt; then this is a non-negative integer indicating what level of the NPA hierarchy should be used when bounding the value of the non-local game. Higher values of &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; give better bounds, but require more memory and time. Alternatively, &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; can be a string of a form like &amp;lt;tt&amp;gt;&#039;1+ab+aab&#039;&amp;lt;/tt&amp;gt;, which indicates that an intermediate level of the hierarchy should be used, where this example uses all products of 1 measurement, all products of one Alice and one Bob measurement, and all products of two Alice and one Bob measurement. Use plus signs to separate the different categories of products, as above. The first character of this string should always be a number, indicating the base level to use. If &amp;lt;tt&amp;gt;MTYPE&amp;lt;/tt&amp;gt; is anything other than &amp;lt;tt&amp;gt;&#039;quantum&#039;&amp;lt;/tt&amp;gt; then &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; has no effect.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===The CHSH game===&lt;br /&gt;
The (quite trivial) BCS game consisting of the following two constraints is equivalent to the [http://en.wikipedia.org/?title=CHSH_inequality CHSH inequality]:&lt;br /&gt;
$$&lt;br /&gt;
v_1 \oplus v_2 = 0 \quad \quad \quad v_1 \oplus v_2 = 1&lt;br /&gt;
$$&lt;br /&gt;
We can compute the classical and quantum values of the game with the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; C{1} = zeros(2,2);&lt;br /&gt;
   C{2} = zeros(2,2);&lt;br /&gt;
   for v1 = 0:1&lt;br /&gt;
       for v2 = 0:1&lt;br /&gt;
           % Set up the first constraint: we win if v1+v2 is even.&lt;br /&gt;
           if(mod(v1+v2,2) == 0)&lt;br /&gt;
               C{1}(v1+1,v2+1) = 1;&lt;br /&gt;
           end&lt;br /&gt;
&lt;br /&gt;
            % Set up the first constraint: we win if v1+v2 is odd.&lt;br /&gt;
           if(mod(v1+v2,2) == 1)&lt;br /&gt;
               C{2}(v1+1,v2+1) = 1;&lt;br /&gt;
           end&lt;br /&gt;
       end&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;classical&#039;) % should give 3/4&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.7500&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;quantum&#039;) % should give cos^2(pi/8)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.8536&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The generalized CHSH game===&lt;br /&gt;
By extending the CHSH game above to have more variables (say $k$ of them), we get the game defined by the following slightly more complicated constraints::&lt;br /&gt;
$$&lt;br /&gt;
v_1 \oplus v_2 \oplus \cdots \oplus v_k = 0 \quad \quad \quad v_1 \oplus v_2 \oplus \cdots \oplus v_k = 1&lt;br /&gt;
$$&lt;br /&gt;
We can compute the classical value and bound the quantum value of the game in the $k = 3$ case with the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; C{1} = zeros(2,2,2);&lt;br /&gt;
   C{2} = zeros(2,2,2);&lt;br /&gt;
   for v1 = 0:1&lt;br /&gt;
       for v2 = 0:1&lt;br /&gt;
           for v3 = 0:1&lt;br /&gt;
               % Set up the first constraint: we win if v1+v2+v3 is even.&lt;br /&gt;
               if(mod(v1+v2+v3,2) == 0)&lt;br /&gt;
                   C{1}(v1+1,v2+1,v3+1) = 1;&lt;br /&gt;
               end&lt;br /&gt;
               % Set up the first constraint: we win if v1+v2+v3 is odd.&lt;br /&gt;
               if(mod(v1+v2+v3,2) == 1)&lt;br /&gt;
                   C{2}(v1+1,v2+1,v3+1) = 1;&lt;br /&gt;
               end&lt;br /&gt;
           end&lt;br /&gt;
       end&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.8333&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;quantum&#039;,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   1.0000&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;quantum&#039;,&#039;1+ab&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.9082&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the first level of the [[NPAHierarchy|NPA hierarchy]] above just gave the (useless) upper bound of 1 on the game&#039;s value. However, increasing the level of the NPA hierarchy to the 1+AB level was sufficient to give a non-trivial upper bound.&lt;br /&gt;
&lt;br /&gt;
===The &amp;quot;four-line&amp;quot; BCS game===&lt;br /&gt;
The BCS game defined by the following four constraints was shown by Speelman not to have a quantum strategy giving a value of 1 (see Section 5 of &amp;lt;ref name=&amp;quot;CM14&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;):&lt;br /&gt;
$$&lt;br /&gt;
v_1 \oplus v_2 \oplus v_3 = 0 \quad \quad \quad v_3 \oplus v_4 \oplus v_5 = 0 \\&lt;br /&gt;
v_5 \oplus v_6 \oplus v_1 = 0 \quad \quad \quad v_2 \oplus v_4 \oplus v_6 = 1.&lt;br /&gt;
$$&lt;br /&gt;
We can compute the classical value and bound the quantum value of this game with the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; C{1} = zeros(2,2,2,2,2,2);&lt;br /&gt;
   C{2} = zeros(2,2,2,2,2,2);&lt;br /&gt;
   C{3} = zeros(2,2,2,2,2,2);&lt;br /&gt;
   C{4} = zeros(2,2,2,2,2,2);&lt;br /&gt;
   for v1 = 0:1&lt;br /&gt;
     for v2 = 0:1&lt;br /&gt;
       for v3 = 0:1&lt;br /&gt;
         for v4 = 0:1&lt;br /&gt;
           for v5 = 0:1&lt;br /&gt;
             for v6 = 0:1&lt;br /&gt;
               % Set up the first constraint.&lt;br /&gt;
               if(mod(v1+v2+v3,2) == 0)&lt;br /&gt;
                 C{1}(v1+1,v2+1,v3+1,v4+1,v5+1,v6+1) = 1;&lt;br /&gt;
               end&lt;br /&gt;
               &lt;br /&gt;
               % Set up the second constraint.&lt;br /&gt;
               if(mod(v3+v4+v5,2) == 0)&lt;br /&gt;
                 C{2}(v1+1,v2+1,v3+1,v4+1,v5+1,v6+1) = 1;&lt;br /&gt;
               end&lt;br /&gt;
               &lt;br /&gt;
               % Set up the third constraint.&lt;br /&gt;
               if(mod(v5+v6+v1,2) == 0)&lt;br /&gt;
                 C{3}(v1+1,v2+1,v3+1,v4+1,v5+1,v6+1) = 1;&lt;br /&gt;
               end&lt;br /&gt;
               &lt;br /&gt;
               % Set up the fourth constraint.&lt;br /&gt;
               if(mod(v2+v4+v6,2) == 1)&lt;br /&gt;
                 C{4}(v1+1,v2+1,v3+1,v4+1,v5+1,v6+1) = 1;&lt;br /&gt;
               end&lt;br /&gt;
             end&lt;br /&gt;
           end&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;classical&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.9167&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;quantum&#039;,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   1.0000&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; BCSGameValue(C,&#039;quantum&#039;,&#039;1+ab&#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.9789&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just like in the previous example, the first level of the [[NPAHierarchy|NPA hierarchy]] above just gave the (useless) upper bound of 1 on the game&#039;s value. However, increasing the level of the NPA hierarchy to the 1+AB level was sufficient to give a non-trivial upper bound.&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=BCSGameValue}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=SymmetricInnerExtension&amp;diff=909</id>
		<title>SymmetricInnerExtension</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=SymmetricInnerExtension&amp;diff=909"/>
		<updated>2018-06-13T16:37:10Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=SymmetricInnerExtension&lt;br /&gt;
|desc=Determines whether or not an operator has a symmetric inner extension&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[IsPPT]]&amp;lt;br /&amp;gt;[[IsSeparable]]&amp;lt;br /&amp;gt;[[SymmetricExtension]]&amp;lt;br /&amp;gt;[[SymmetricProjection]]&lt;br /&gt;
|cat=[[List of functions#Entanglement_and_separability|Entanglement&amp;amp;nbsp;and&amp;amp;nbsp;separability]]&lt;br /&gt;
|upd=September 22, 2014&lt;br /&gt;
|v=0.50}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;SymmetricInnerExtension&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that determines whether or not a given [[positive semidefinite]] operator is in the cone defined in reference &amp;lt;ref name=&amp;quot;NOP09&amp;quot;&amp;gt;M. Navascués, M. Owari, and M. B. Plenio. Complete Criterion for Separability Detection. &amp;lt;em&amp;gt;Physical Review Letters&amp;lt;/em&amp;gt;, 103:160404, 2009. E-print: [http://arxiv.org/abs/0906.2735 arXiv:0906.2735] [quant-ph]&amp;lt;/ref&amp;gt; that approximates the set of separable operators from the inside, based on operators with [[symmetric extension]]s. Importantly, if this script returns a value of &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt; then we know that the given operator is separable (if the script returns a value of &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;, we know nothing about whether the operator is separable or entangled).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricInnerExtension(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricInnerExtension(X,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricInnerExtension(X,K,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricInnerExtension(X,K,DIM,PPT)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricInnerExtension(X,K,DIM,PPT,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[EX,WIT] = SymmetricInnerExtension(X,K,DIM,PPT,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: A positive semidefinite operator.&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default 2): The number of copies of the second subsystem in the desired symmetric extension.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, by default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the two subsystems that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; acts on.&lt;br /&gt;
* &amp;lt;tt&amp;gt;PPT&amp;lt;/tt&amp;gt; (optional, default 0): A flag (either 1 or 0) that indicates whether or not the desired symmetric extension must have [[positive partial transpose]].&lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;eps^(1/4)&amp;lt;/tt&amp;gt;): The numerical tolerance used throughout this script. It is recommended that this is left at the default value unless numerical problems arise and the script has difficulty determining whether or not &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; has a symmetric inner extension.&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX&amp;lt;/tt&amp;gt;: A flag (either 1 or 0) indicating that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; does or does not have a symmetric inner extension of the desired type. A value of 1 means that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; is [[separable]].&lt;br /&gt;
* &amp;lt;tt&amp;gt;WIT&amp;lt;/tt&amp;gt; (optional): A witness that verifies that the answer provided by &amp;lt;tt&amp;gt;EX&amp;lt;/tt&amp;gt; is correct. If &amp;lt;tt&amp;gt;EX = 1&amp;lt;/tt&amp;gt; (i.e., &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; is in the &amp;quot;inner&amp;quot; symmetric extension cone) then &amp;lt;tt&amp;gt;WIT&amp;lt;/tt&amp;gt; is a symmetric extension of the operator &amp;lt;math&amp;gt;\sigma_{AB}&amp;lt;/math&amp;gt; from &amp;lt;ref name=&amp;quot;NOP09&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;, and thus acts as a witness that verifies that &amp;lt;tt&amp;gt;EX = 1&amp;lt;/tt&amp;gt; is correct. If &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; is not in this cone (i.e., &amp;lt;tt&amp;gt;EX = 0&amp;lt;/tt&amp;gt;) then &amp;lt;tt&amp;gt;WIT&amp;lt;/tt&amp;gt; is an operator with &amp;lt;tt&amp;gt;trace(WIT*X) = -1&amp;lt;/tt&amp;gt; but &amp;lt;tt&amp;gt;trace(WIT*Y) &amp;gt;= 0&amp;lt;/tt&amp;gt; for all operators in the described cone. Note that &amp;lt;tt&amp;gt;WIT&amp;lt;/tt&amp;gt; may not be an [[entanglement witness]]!&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following code takes an unnormalized quantum state and shows that it is separable, since it has a symmetric inner extension.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = [11     4    -1    -1    -1    -1    -1    -1    -1&lt;br /&gt;
           4    11    -1    -1    -1    -1    -1    -1    -1&lt;br /&gt;
          -1    -1    11    -1    -1     4    -1    -1    -1&lt;br /&gt;
          -1    -1    -1    11    -1    -1     4    -1    -1&lt;br /&gt;
          -1    -1    -1    -1    16    -1    -1    -1    -1&lt;br /&gt;
          -1    -1     4    -1    -1    11    -1    -1    -1&lt;br /&gt;
          -1    -1    -1     4    -1    -1    11    -1    -1&lt;br /&gt;
          -1    -1    -1    -1    -1    -1    -1    11     4&lt;br /&gt;
          -1    -1    -1    -1    -1    -1    -1     4    11];&lt;br /&gt;
&amp;gt;&amp;gt; SymmetricInnerExtension(rho,2,[3,3],1) % we set PPT=1, since this makes the separability test stronger&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we subtract the identity from &amp;lt;tt&amp;gt;rho&amp;lt;/tt&amp;gt;, then intuitively it becomes &amp;quot;less separable&amp;quot;. We can verify this as follows, where we see that setting &amp;lt;tt&amp;gt;K = 2&amp;lt;/tt&amp;gt; is no longer sufficient to prove that the state is separable, and instead we must set &amp;lt;tt&amp;gt;K = 3&amp;lt;/tt&amp;gt;. In general, the higher &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; is, the stronger the test for separability is, but the longer and more memory-intensive the computation is.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; SymmetricInnerExtension(rho-eye(9),2,[3,3],1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; SymmetricInnerExtension(rho-eye(9),3,[3,3],1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
If your goal is to prove that an operator is separable, it is probably in your best interest to see the optional argument &amp;lt;tt&amp;gt;PPT&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;. It only defaults to &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; to be consistent with the &amp;lt;tt&amp;gt;[[SymmetricExtension]]&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=SymmetricInnerExtension}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=SymmetricExtension&amp;diff=908</id>
		<title>SymmetricExtension</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=SymmetricExtension&amp;diff=908"/>
		<updated>2018-06-13T16:36:57Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=SymmetricExtension&lt;br /&gt;
|desc=Determines whether or not an operator has a symmetric extension&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[IsPPT]]&amp;lt;br /&amp;gt;[[IsSeparable]]&amp;lt;br /&amp;gt;[[SymmetricInnerExtension]]&amp;lt;br /&amp;gt;[[SymmetricProjection]]&lt;br /&gt;
|cat=[[List of functions#Entanglement_and_separability|Entanglement&amp;amp;nbsp;and&amp;amp;nbsp;separability]]&lt;br /&gt;
|upd=February 21, 2014&lt;br /&gt;
|v=0.50}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;SymmetricExtension&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that determines whether or not a given positive semidefinite operator has a symmetric extension. This function is extremely useful for showing that quantum states are entangled (see the [[#Examples|Examples]] section). Various types of symmetric extensions (such as Bosonic and/or PPT extensions) can be looked for by specifying optional arguments in the function.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricExtension(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricExtension(X,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricExtension(X,K,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricExtension(X,K,DIM,PPT)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricExtension(X,K,DIM,PPT,BOS)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX = SymmetricExtension(X,K,DIM,PPT,BOS,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[EX,WIT] = SymmetricExtension(X,K,DIM,PPT,BOS,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: A positive semidefinite operator.&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default 2): The number of copies of the second subsystem in the desired symmetric extension.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, by default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the two subsystems that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; acts on.&lt;br /&gt;
* &amp;lt;tt&amp;gt;PPT&amp;lt;/tt&amp;gt; (optional, default 0): A flag (either 1 or 0) that indicates whether or not the desired symmetric extension must have positive partial transpose.&lt;br /&gt;
* &amp;lt;tt&amp;gt;BOS&amp;lt;/tt&amp;gt; (optional, default 0): A flag (either 1 or 0) that indicates whether or not the desired symmetric extension must be Bosonic (i.e., have its range contained within the symmetric subspace).&lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;eps^(1/4)&amp;lt;/tt&amp;gt;): The numerical tolerance used throughout this script. It is recommended that this is left at the default value unless numerical problems arise and the script has difficulty determining whether or not &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; has a symmetric extension.&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;EX&amp;lt;/tt&amp;gt;: A flag (either 1 or 0) indicating that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; does or does not have a symmetric extension of the desired type.&lt;br /&gt;
* &amp;lt;tt&amp;gt;WIT&amp;lt;/tt&amp;gt; (optional): A witness that verifies that the answer provided by &amp;lt;tt&amp;gt;EX&amp;lt;/tt&amp;gt; is correct. If &amp;lt;tt&amp;gt;EX = 1&amp;lt;/tt&amp;gt; (i.e., &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; has a symmetric extension) then &amp;lt;tt&amp;gt;WIT&amp;lt;/tt&amp;gt; is such a symmetric extension. If &amp;lt;tt&amp;gt;EX = 0&amp;lt;/tt&amp;gt; (i.e., no symmetric extension exists) then WIT is an entanglement witness with &amp;lt;tt&amp;gt;trace(WIT*X) = -1&amp;lt;/tt&amp;gt; but &amp;lt;tt&amp;gt;trace(WIT*Y) &amp;gt;= 0&amp;lt;/tt&amp;gt; for all symmetrically extendable &amp;lt;tt&amp;gt;Y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===2-qubit symmetric extension===&lt;br /&gt;
It is known&amp;lt;ref&amp;gt;J. Chen, Z. Ji, D. Kribs, N. Lütkenhaus, and B. Zeng. &#039;&#039;Symmetric extension of two-qubit states&#039;&#039;. E-print: [http://arxiv.org/abs/1310.3530 arXiv:1310.3530] [quant-ph]&amp;lt;/ref&amp;gt; that a 2-qubit state $\rho_{AB}$ has a (not necessarily PPT) symmetric extension if and only if ${\rm Tr}(\rho_B^2) \geq {\rm Tr}(\rho_{AB}^2) - 4\sqrt{\det(\rho_{AB})}$. The following code verifies that one such state does indeed have a symmetric extension.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = [1 0 0 -1;0 1 1/2 0;0 1/2 1 0;-1 0 0 1];&lt;br /&gt;
&amp;gt;&amp;gt; [trace(PartialTrace(rho)^2), trace(rho^2) - 4*sqrt(det(rho))] % if the first number is &amp;gt;= the second number, rho has a symmetric extension&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    8.0000    6.5000&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; SymmetricExtension(rho) % verify that rho has a symmetric extension&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
If your goal is to detect entanglement in an operator, then it is always in your best interest to set the optional arguments &amp;lt;tt&amp;gt;PPT&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;BOS&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;. Setting &amp;lt;tt&amp;gt;BOS = 1&amp;lt;/tt&amp;gt; increases the effectiveness of the entanglement test without any computational overhead at all. Setting &amp;lt;tt&amp;gt;PPT = 1&amp;lt;/tt&amp;gt; slows down the computation quite a bit, but increases the effectiveness as an entanglement test &#039;&#039;considerably&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=SymmetricExtension}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=IsSeparable&amp;diff=907</id>
		<title>IsSeparable</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=IsSeparable&amp;diff=907"/>
		<updated>2018-06-13T16:36:32Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=IsSeparable&lt;br /&gt;
|desc=Determines whether or not a bipartite operator is separable&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[InSeparableBall]]&amp;lt;br /&amp;gt;[[IsBlockPositive]]&amp;lt;br /&amp;gt;[[IsPPT]]&amp;lt;br /&amp;gt;[[IsPSD]]&amp;lt;br /&amp;gt;[[OperatorSchmidtDecomposition]]&amp;lt;br /&amp;gt;[[OperatorSchmidtRank]]&amp;lt;br /&amp;gt;[[SymmetricExtension]]&amp;lt;br /&amp;gt;[[SymmetricInnerExtension]]&lt;br /&gt;
|cat=[[List of functions#Entanglement_and_separability|Entanglement&amp;amp;nbsp;and&amp;amp;nbsp;separability]]&lt;br /&gt;
|upd=November 14, 2014&lt;br /&gt;
|v=0.60}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;IsSeparable&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that determines whether a bipartite operator is separable or entangled. A value of 0 indicates that the operator is entangled, a value of 1 indicates that the operator is separable, and a value of -1 indicates that the script was unable to determine whether the operator is separable or entangled.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;SEP = IsSeparable(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SEP = IsSeparable(X,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SEP = IsSeparable(X,DIM,STR)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SEP = IsSeparable(X,DIM,STR,VERBOSE)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SEP = IsSeparable(X,DIM,STR,VERBOSE,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: A bipartite positive semidefinite operator.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, by default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the two subsystems that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; acts on.&lt;br /&gt;
* &amp;lt;tt&amp;gt;STR&amp;lt;/tt&amp;gt; (optional, default 2): An integer that determines how hard the script should work to determine separability before giving up (&amp;lt;tt&amp;gt;STR = -1&amp;lt;/tt&amp;gt; means that the script won&#039;t stop working until it finds an answer). Other valid values are &amp;lt;tt&amp;gt;0, 1, 2, 3, ...&amp;lt;/tt&amp;gt;. In practice, if &amp;lt;tt&amp;gt;STR &amp;gt;= 4&amp;lt;/tt&amp;gt; then most computers will run out of memory and/or the sun will explode before computation completes.&lt;br /&gt;
* &amp;lt;tt&amp;gt;VERBOSE&amp;lt;/tt&amp;gt; (optional, default 1): A flag (either 0 or 1) that indicates that the script will or will not display a line of text describing how it proved that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; is or is not separable.&lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;eps^(3/8)&amp;lt;/tt&amp;gt;): The numerical tolerance used throughout the script.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Determining entanglement of a bound entangled state===&lt;br /&gt;
The following code constructs a two-qutrit bound entangled state based on the &amp;quot;Tiles&amp;quot; unextendible product basis. This state&#039;s entanglement can not be detected by the positive partial transpose criterion, but the following code shows that it is indeed entangled.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; v = UPB(&#039;Tiles&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; rho = eye(9);&lt;br /&gt;
&amp;gt;&amp;gt; for j = 1:5&lt;br /&gt;
       rho = rho - v(:,j)*v(:,j)&#039;;&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; rho = rho/4; % we are now done constructing the bound entangled state&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(rho)&lt;br /&gt;
Determined to be entangled via the realignment criterion. Reference:&lt;br /&gt;
K. Chen and L.-A. Wu. A matrix realignment method for recognizing entanglement.&lt;br /&gt;
Quantum Inf. Comput., 3:193-202, 2003.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following code performs the same computation, but has &amp;lt;tt&amp;gt;VERBOSE&amp;lt;/tt&amp;gt; set to 0 so that the method of proving that &amp;lt;tt&amp;gt;rho&amp;lt;/tt&amp;gt; is entangled is not displayed.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(rho,[3,3],2,0)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mixtures with the maximally-mixed state===&lt;br /&gt;
Every state that is sufficiently close to the maximally-mixed state is separable, so for every entangled state $\rho \in M_A \otimes M_B$, the state $\sigma_p := p\rho + \tfrac{1}{d_A d_B}(1-p)I$ is separable as long as $p$ is small enough.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this example, $\rho$ is the same bound entangled state based on the &amp;quot;Tiles&amp;quot; UPB from the [[#Determining_entanglement_of_a_bound_entangled_state|previous example]]. It was shown in &amp;lt;ref name=&amp;quot;GGHE08&amp;quot;&amp;gt;O. Gittsovich, O. Gühne, P. Hyllus, and J. Eisert. Unifying several separability conditions using the covariance matrix criterion. Phys. Rev. A, 78:052319, 2008. E-print: [http://arxiv.org/abs/0803.0757 arXiv:0803.0757] [quant-ph]&amp;lt;/ref&amp;gt; that the Filter Covariance Matrix Criterion detects the entanglement in $\sigma_p$ when $p = 0.8723$, which we can verify as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = 0.8723; sigma = p*rho + (1-p)*eye(9)/9;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(sigma)&lt;br /&gt;
Determined to be entangled via the Filter Covariance Matrix Criterion. Reference:&lt;br /&gt;
O. Gittsovich, O. Gühne, P. Hyllus, and J. Eisert. Unifying several separability&lt;br /&gt;
conditions using the covariance matrix criterion. Phys. Rev. A, 78:052319, 2008.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if we decrease $p$ to $p = 0.8722$ then a stronger test of entanglement is needed to determine that $\sigma_p$ is entangled:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = 0.8722; sigma = p*rho + (1-p)*eye(9)/9;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(sigma)&lt;br /&gt;
Determined to be entangled by not having a 2-copy symmetric extension. Reference:&lt;br /&gt;
A. C. Doherty, P. A. Parrilo, and F. M. Spedalieri. A complete family of separability&lt;br /&gt;
criteria. Phys. Rev. A, 69:022308, 2004.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we decrease $p$ further, then $\sigma_p$ becomes separable:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = 0.2; sigma = p*rho + (1-p)*eye(9)/9;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(sigma)&lt;br /&gt;
Determined to be separable by closeness to the maximally mixed state. Reference:&lt;br /&gt;
L. Gurvits and H. Barnum. Largest separable balls around the maximally mixed bipartite&lt;br /&gt;
quantum state. Phys. Rev. A, 66:062311, 2002.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we increase $p$ back to $p = 0.4$ then $\sigma_p$ is still separable, but a stronger test is required to prove its separability:     &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = 0.4; sigma = p*rho + (1-p)*eye(9)/9;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(sigma)&lt;br /&gt;
Determined to be separable via the semidefinite program based on 2-copy symmetric extensions from reference:&lt;br /&gt;
M. Navascues, M. Owari, and M. B. Plenio. A complete criterion for separability detection. Phys. Rev. Lett.,&lt;br /&gt;
103:160404, 2009.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we increase $p$ slightly more to $p = 0.45$ then $\sigma_p$ is still separable, but none of the default tests for separability are strong enough to determine this. To prove separability, we can increase the &amp;lt;tt&amp;gt;STR&amp;lt;/tt&amp;gt; argument to 3:     &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; p = 0.45; sigma = p*rho + (1-p)*eye(9)/9;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(sigma)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    -1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(sigma,[3,3],3)&lt;br /&gt;
Determined to be separable via the semidefinite program based on 3-copy symmetric extensions from reference:&lt;br /&gt;
M. Navascues, M. Owari, and M. B. Plenio. A complete criterion for separability detection. Phys. Rev. Lett., 103:160404, 2009.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Isotropic states===&lt;br /&gt;
It is well-known that [[IsotropicState|isotropic states]] $(1-\alpha)I/d^2 + \alpha|\psi_+\rangle\langle\psi_+| \in M_d \otimes M_d$ are separable if and only if $\alpha \leq 1/(d+1)$,&amp;lt;ref name=&amp;quot;HH97&amp;quot;&amp;gt;M. Horodecki and P. Horodecki. Reduction criterion of separability and limits for a class of distillation protocols. Phys. Rev. A, 59:4206&amp;amp;ndash;4216, 1999. E-print: [http://arxiv.org/abs/quant-ph/9708015 arXiv:quant-ph/9708015]&amp;lt;/ref&amp;gt; which can be verified in the $d = 3$ case as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; d = 3;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(IsotropicState(d, 1/(d+1)))&lt;br /&gt;
Determined to be separable by being a small rank-1 perturbation of the maximally-mixed state. Reference:&lt;br /&gt;
G. Vidal and R. Tarrach. Robustness of entanglement. Phys. Rev. A, 59:141-155, 1999.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(IsotropicState(d, 1/(d+1)+0.0001))&lt;br /&gt;
Determined to be entangled via the realignment criterion. Reference:&lt;br /&gt;
K. Chen and L.-A. Wu. A matrix realignment method for recognizing entanglement. Quantum Inf. Comput., 3:193-202, 2003.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Werner states===&lt;br /&gt;
It is well-known that [[WernerState|Werner states]] $\frac{1}{d^2-d\alpha}(I\otimes I - \alpha S) \in M_d \otimes M_d$ are separable if and only if $\alpha \leq 1/d$,&amp;lt;ref name=&amp;quot;Wer89&amp;quot;&amp;gt;R. F. Werner. Quantum states with Einstein-Podolsky-Rosen correlations admitting a hidden-variable model. &#039;&#039;Phys. Rev. A&#039;&#039;, 40(8):4277&amp;amp;ndash;4281.&amp;lt;/ref&amp;gt; which can be verified in the $d = 3$ case as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; d = 3;&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(WernerState(d, 1/d))&lt;br /&gt;
Determined to be separable by closeness to the maximally mixed state. Reference:&lt;br /&gt;
L. Gurvits and H. Barnum. Largest separable balls around the maximally mixed bipartite quantum state. Phys. Rev. A, 66:062311, 2002.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; IsSeparable(WernerState(d, 1/d+0.0001))&lt;br /&gt;
Determined to be entangled via the PPT criterion. Reference:&lt;br /&gt;
A. Peres. Separability criterion for density matrices. Phys. Rev. Lett., 77:1413-1415, 1996.&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
In general, we are much better at proving that an operator is entangled than we are at proving that it is separable. Thus, if this script returns a value of -1 (indicating that it was unable to prove that the operator is separable or entangled) then that is a pretty good indicator that the operator is probably separable.&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=IsSeparable}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=IsBlockPositive&amp;diff=906</id>
		<title>IsBlockPositive</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=IsBlockPositive&amp;diff=906"/>
		<updated>2018-06-13T16:35:45Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=IsBlockPositive&lt;br /&gt;
|desc=Determines whether or not an operator is block positive&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[IsPPT]]&amp;lt;br /&amp;gt;[[IsPSD]]&amp;lt;br /&amp;gt;[[IsSeparable]]&lt;br /&gt;
|cat=[[List of functions#Entanglement_and_separability|Entanglement&amp;amp;nbsp;and&amp;amp;nbsp;separability]]&lt;br /&gt;
|upd=September 23, 2014&lt;br /&gt;
|v=0.50}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;IsBlockPositive&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that determines whether or not a bipartite operator is block positive (roughly speaking, it determines whether the operator is an entanglement witness or not). A value of 0 indicates that the operator is not block positive (and hence is not an entanglement witness), a value of 1 indicates that the operator is block positive (and hence is either an entanglement witness or is positive semidefinite), and a value of -1 indicates that the script was unable to determine whether or not the operator is block positive.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;IBP = IsBlockPositive(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;IBP = IsBlockPositive(X,K)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;IBP = IsBlockPositive(X,K,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;IBP = IsBlockPositive(X,K,DIM,STR)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;IBP = IsBlockPositive(X,K,DIM,STR,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[IBP,WIT] = IsBlockPositive(X,K,DIM,STR,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: A bipartite Hermitian operator.&lt;br /&gt;
* &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt; (optional, default 1): A positive integer indicating that the script should determine whether or not &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt;-block positive (i.e., whether or not it remains nonnegative under left and right multiplication by vectors with [[SchmidtRank|Schmidt rank]] &amp;lt;tt&amp;gt;&amp;lt;= K&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, by default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the two subsystems that &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; acts on.&lt;br /&gt;
* &amp;lt;tt&amp;gt;STR&amp;lt;/tt&amp;gt; (optional, default 2): An integer that determines how hard the script should work to determine block positivity before giving up (&amp;lt;tt&amp;gt;STR = -1&amp;lt;/tt&amp;gt; means that the script won&#039;t stop working until it finds an answer). Other valid values are &amp;lt;tt&amp;gt;0, 1, 2, 3, ...&amp;lt;/tt&amp;gt;. In practice, if &amp;lt;tt&amp;gt;STR &amp;gt;= 4&amp;lt;/tt&amp;gt; then most computers will run out of memory and/or the sun will explode before computation completes.&lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;eps^(3/8)&amp;lt;/tt&amp;gt;): The numerical tolerance used throughout the script.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===The [[SwapOperator|swap operator]] is block positive===&lt;br /&gt;
The [[SwapOperator|swap operator]] always block positive, since it is the Choi matrix of the transpose map (and it is easy to see that the transpose map is positive). We can verify this in small dimensions as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; for d = 2:10&lt;br /&gt;
       res(d) = IsBlockPositive(SwapOperator(d));&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; res(2:10)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     1     1     1     1     1     1     1     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the swap operator is &#039;&#039;not&#039;&#039; 2-block positive, which we can verify as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; IsBlockPositive(SwapOperator(5),2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The [[ChoiMap|Choi map]] is positive===&lt;br /&gt;
The [[ChoiMap|Choi map]] is a well-known example of a positive linear map that acts on 3-by-3 matrices. The following code verifies that this map is indeed positive, but not 2-positive:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; IsBlockPositive(ChoiMap())&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; IsBlockPositive(ChoiMap(),2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===A complicated operator on 4 local dimensions===&lt;br /&gt;
A somewhat messy positive linear map was introduced in Lemma 3 of &amp;lt;ref name=&amp;quot;BCJRWY14&amp;quot;&amp;gt;S.&amp;amp;nbsp;Bandyopadhyay, A.&amp;amp;nbsp;Cosentino, N.&amp;amp;nbsp;Johnston, V.&amp;amp;nbsp;Russo, J.&amp;amp;nbsp;Watrous, and N.&amp;amp;nbsp;Yu. &#039;&#039;Limitations on separable measurements by convex optimization&#039;&#039;. E-print: [http://arxiv.org/abs/1408.6981 arXiv:1408.6981] [quant-ph], 2014.&amp;lt;/ref&amp;gt;. The following code verifies that this map is indeed positive in the $t = 1$ case.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; b0 = Bell(0);&lt;br /&gt;
&amp;gt;&amp;gt; b3 = Bell(3);&lt;br /&gt;
&amp;gt;&amp;gt; v0 = kron(b0,b0);&lt;br /&gt;
&amp;gt;&amp;gt; Y = (kron(eye(4),b0*b0&#039;)/2 + kron(b3*b3&#039;,PartialTranspose(b3*b3&#039;,1)))/3 - v0*v0&#039;/4;&lt;br /&gt;
&amp;gt;&amp;gt; Y = Swap(Y,[2,2,2,2],[2,3]); % this is the Choi matrix of the linear map given in Lemma 3&lt;br /&gt;
&amp;gt;&amp;gt; IsBlockPositive(Y)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=IsBlockPositive}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=UPBSepDistinguishable&amp;diff=905</id>
		<title>UPBSepDistinguishable</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=UPBSepDistinguishable&amp;diff=905"/>
		<updated>2018-06-13T16:34:15Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=UPBSepDistinguishable&lt;br /&gt;
|desc=Determines whether or not a UPB is distinguishable by separable measurements&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[LocalDistinguishability]]&lt;br /&gt;
|cat=[[List of functions#Distinguishing_objects|Distinguishing objects]]&lt;br /&gt;
|upd=October 30, 2014&lt;br /&gt;
|v=0.50}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;UPBSepDistinguishable&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that determines whether or not a given [[UPB]] is perfectly distinguishable by separable measurements. This question is interesting because it is known that all UPBs are indistinguishable by LOCC measurements &amp;lt;ref&amp;gt;C. Bennett, D. DiVincenzo, T. Mor, P. Shor, J. Smolin, and B. Terhal. Unextendible product bases and bound entanglement. &#039;&#039;Physical Review Letters&#039;&#039;, 82(26):5385&amp;amp;ndash;5388, 1999. E-print: [http://arxiv.org/abs/quant-ph/9808030 arXiv:quant-ph/9808030]&amp;lt;/ref&amp;gt;, and all UPBs are distinguishable by PPT measurements. Separable measurements lie between these two classes.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = UPBSepDistinguishable(U,V,W,...)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;U,V,W,...&amp;lt;/tt&amp;gt;: Matrices, each with the same number of columns as each other, whose columns are the local vectors of the UPB.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Qutrit UPBs are distinguishable===&lt;br /&gt;
It was shown in &amp;lt;ref&amp;gt;D. DiVincenzo, T. Mor, P. W. Shor, J. Smolin, and B. Terhal. Unextendible product bases, uncompletable product bases and bound entanglement. &#039;&#039;Communications in Mathematical Physics&#039;&#039;, 238(3):379&amp;amp;ndash;410, 2003. E-print: [http://arxiv.org/abs/quant-ph/9908070 arXiv:quant-ph/9908070]&amp;lt;/ref&amp;gt; that all UPBs in $\mathbb{C}^3 \otimes \mathbb{C}^3$ are distinguishable by separable measurements. We can verify this fact for the &amp;quot;Tiles&amp;quot; UPB as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; [u,v] = UPB(&#039;Tiles&#039;); % generates the &amp;quot;Tiles&amp;quot; UPB&lt;br /&gt;
&amp;gt;&amp;gt; UPBSepDistinguishable(u,v)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The Feng UPB is indistinguishable===&lt;br /&gt;
It was shown in &amp;lt;ref&amp;gt;S. Bandyopadhyay, A. Cosentino, N. Johnston, V. Russo, J. Watrous, and N. Yu. &#039;&#039;Limitations on separable measurements by convex optimization&#039;&#039;. E-print: [http://arxiv.org/abs/1408.6981 arXiv:1408.6981] [quant-ph], 2014.&amp;lt;/ref&amp;gt; that the UPB in $\mathbb{C}^4 \otimes \mathbb{C}^4$ found by K. Feng is indistinguishable by separable measurements. We can confirm this fact as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; [u,v] = UPB(&#039;Feng4x4&#039;); % generates the &amp;quot;Feng&amp;quot; UPB&lt;br /&gt;
&amp;gt;&amp;gt; UPBSepDistinguishable(u,v)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=UPBSepDistinguishable}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=LocalDistinguishability&amp;diff=904</id>
		<title>LocalDistinguishability</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=LocalDistinguishability&amp;diff=904"/>
		<updated>2018-06-13T16:33:52Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=LocalDistinguishability&lt;br /&gt;
|desc=Computes the maximum probability of distinguishing quantum states by symmetric-extendible measurements&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[ChannelDistinguishability]]&amp;lt;br /&amp;gt;[[Distinguishability]]&lt;br /&gt;
|cat=[[List of functions#Distinguishing_objects|Distinguishing objects]]&lt;br /&gt;
|upd=December 19, 2014}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;LocalDistinguishability&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the maximum probability of distinguishing two or more quantum states via PPT or symmetric-extendible measurements, which approximate separable measurements. That is, this function computes the maximum probability of winning the following game: You are given a complete description of a set of $k$ quantum states $\rho_1, \ldots, \rho_k$, and then are given one of those $k$ states, and asked to determine (via quantum measurement) which state was given to you. However, the only measurements that are available to you are &amp;quot;almost&amp;quot; local in the sense that they are PPT and/or have a symmetric extension.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = LocalDistinguishability(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[DIST,MEAS,DUAL_SOL] = LocalDistinguishability(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[DIST,MEAS,DUAL_SOL] = LocalDistinguishability(X,...)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: The quantum states to be distinguished. &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; can either be a cell containing 2 or more density matrices, or &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; can be a matrix whose columns are pure vector states.&lt;br /&gt;
* &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;[1/k, 1/k, ..., 1/k]&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;k&amp;lt;/tt&amp;gt; is the number of quantum states): A vector whose j-th entry is the probability that the state $\rho_j$ is given to you in the game described above. * &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the subsystems on which the states described by &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; act.&lt;br /&gt;
* &amp;lt;tt&amp;gt;COPIES&amp;lt;/tt&amp;gt; (optional, default 2): The number of copies of the second subsystem (i.e., the measurements will have a &amp;lt;tt&amp;gt;COPIES&amp;lt;/tt&amp;gt;-level symmetric extension).&lt;br /&gt;
* &amp;lt;tt&amp;gt;PPT&amp;lt;/tt&amp;gt; (optonal, default &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt;): A flag (either &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt;) indicating whether the symmetric extensions of the measurement operators must have positive partial transpose.&lt;br /&gt;
* &amp;lt;tt&amp;gt;BOS&amp;lt;/tt&amp;gt; (optonal, default &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt;): A flag (either &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt;) indicating whether the symmetric extensions of the measurement operators must be Bosonic (i.e., be supported on the symmetric subspace). &lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optonal, default &amp;lt;tt&amp;gt;eps^(1/4)&amp;lt;/tt&amp;gt;): The numerical tolerance used when determining whether or not a symmetric extension exists.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important note:&#039;&#039;&#039; The input arguments are mutually optional (this is different from other QETLAB functions!). For example, if you want to specify the number of &amp;lt;tt&amp;gt;COPIES&amp;lt;/tt&amp;gt; to 3 and the dimension of the two subsystems to &amp;lt;tt&amp;gt;[2 3]&amp;lt;/tt&amp;gt;, you can call the function as follows: &amp;lt;tt&amp;gt;LocalDistinguishability(X, &#039;COPIES&#039;, 3, &#039;DIM&#039;, [2 3])&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST&amp;lt;/tt&amp;gt;: The maximum probability of distinguishing the states specified by &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MEAS&amp;lt;/tt&amp;gt; (optional): A cell containing optimal measurement operators that distinguish the states specified by &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; with probability &amp;lt;tt&amp;gt;DIST&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DUAL_SOL&amp;lt;/tt&amp;gt; (optional): A dual solution that verifies that the maximum distinguishability probability is indeed no larger than &amp;lt;tt&amp;gt;DIST&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Some examples should be added.&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=LocalDistinguishability}}&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
The methods used by this function to compute the local distinguishability of quantum states was developed in &amp;lt;ref&amp;gt;A. Cosentino. &#039;&#039;Quantum State Local Distinguishability via Convex Optimization&#039;&#039;. PhD thesis, University of Waterloo, 2015.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Distinguishability&amp;diff=903</id>
		<title>Distinguishability</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Distinguishability&amp;diff=903"/>
		<updated>2018-06-13T16:33:17Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=Distinguishability&lt;br /&gt;
|desc=Computes the maximum probability of distinguishing quantum states&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[ChannelDistinguishability]]&amp;lt;br /&amp;gt;[[LocalDistinguishability]]&lt;br /&gt;
|cat=[[List of functions#Distinguishing_objects|Distinguishing objects]]&lt;br /&gt;
|upd=October 6, 2014&lt;br /&gt;
|v=0.50}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;Distinguishability&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the maximum probability of distinguishing two or more quantum states. That is, this function computes the maximum probability of winning the following game: You are given a complete description of a set of $k$ quantum states $\rho_1, \ldots, \rho_k$, and then are given one of those $k$ states, and asked to determine (via quantum measurement) which state was given to you.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = Distinguishability(X)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = Distinguishability(X,P)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[DIST,MEAS] = Distinguishability(X,P)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;: The quantum states to be distinguished. &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; can either be a cell containing 2 or more density matrices, or &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; can be a matrix whose columns are pure vector states.&lt;br /&gt;
* &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;[1/k, 1/k, ..., 1/k]&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;k&amp;lt;/tt&amp;gt; is the number of quantum states): A vector whose j-th entry is the probability that the state $\rho_j$ is given to you in the game described above. All entries must be non-negative, and the entries of this vector must sum to 1.&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST&amp;lt;/tt&amp;gt;: The maximum probability of distinguishing the states specified by &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MEAS&amp;lt;/tt&amp;gt; (optional): A cell containing optimal measurement operators that distinguish the states specified by &amp;lt;tt&amp;gt;X&amp;lt;/tt&amp;gt; with probability &amp;lt;tt&amp;gt;DIST&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Orthogonal states can be perfectly distinguished===&lt;br /&gt;
Any number of quantum states can be perfectly distinguished (i.e., distinguished with probability 1) if they are mutually orthogonal. The following code generates a random $6\times 6$ unitary matrix (i.e., a matrix with orthogonal pure states as columns) and verifies that those pure states are perfectly distinguishable:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; Distinguishability(RandomUnitary(6))&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Two states===&lt;br /&gt;
The maximum probability of distinguishing two quantum states $\rho$ and $\sigma$ is exactly $\frac{1}{2} + \frac{1}{4}\|\rho - \sigma\|_1$&amp;lt;ref&amp;gt;John Watrous. [https://cs.uwaterloo.ca/~watrous/CS766/LectureNotes/all.pdf Theory of Quantum Information lecture notes], Fall 2011.&amp;lt;/ref&amp;gt;, where $\|\cdot\|_1$ is the [[TraceNorm|trace norm]]. We can verify this in a special case as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = RandomDensityMatrix(4);&lt;br /&gt;
&amp;gt;&amp;gt; sigma = RandomDensityMatrix(4);&lt;br /&gt;
&amp;gt;&amp;gt; Distinguishability({rho, sigma})&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7762&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; 1/2 + TraceNorm(rho - sigma)/4&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7762&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Three or more states===&lt;br /&gt;
We can also compute the maximum probability of distinguishing three or more states, but no simple formula is known in this case.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; for j = 1:6&lt;br /&gt;
       rho{j} = RandomDensityMatrix(4);&lt;br /&gt;
   end&lt;br /&gt;
&amp;gt;&amp;gt; Distinguishability(rho)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.4156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{SourceCode|name=Distinguishability}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=ChannelDistinguishability&amp;diff=902</id>
		<title>ChannelDistinguishability</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=ChannelDistinguishability&amp;diff=902"/>
		<updated>2018-06-13T16:32:21Z</updated>

		<summary type="html">&lt;p&gt;Rmmateri: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=ChannelDistinguishability&lt;br /&gt;
|desc=Computes the maximum probability of distinguishing two quantum channels&lt;br /&gt;
|req=[http://cvxr.com/cvx/ CVX]&lt;br /&gt;
|rel=[[Distinguishability]]&amp;lt;br /&amp;gt;[[LocalDistinguishability]]&lt;br /&gt;
|cat=[[List of functions#Distinguishing_objects|Distinguishing objects]]&lt;br /&gt;
|upd=November 27, 2014}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;ChannelDistinguishability&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes the maximum probability of distinguishing two quantum channels. That is, this function computes the maximum probability of winning the following game: You are given a complete description of two quantum channels $\Phi$ and $\Psi$, and then are given one of those two channels, and asked to determine which channel was given to you (by supplying some input state to the channel and then measuring the output).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = ChannelDistinguishability(PHI,PSI)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = ChannelDistinguishability(PHI,PSI,P)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIST = ChannelDistinguishability(PHI,PSI,P,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;PHI,PSI&amp;lt;/tt&amp;gt;: The quantum channels to be distinguished. They can either be input as Choi matrices or as cells of Kraus operators.&lt;br /&gt;
* &amp;lt;tt&amp;gt;P&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;[1/2, 1/2]&amp;lt;/tt&amp;gt;): A vector that specifies that &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PSI&amp;lt;/tt&amp;gt; are chosen with probability &amp;lt;tt&amp;gt;P(1)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;P(2)&amp;lt;/tt&amp;gt;, respectively.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, by default tries to guess the input and output dimensions): A 1-by-2 vector containing the input and output dimensions of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PSI&amp;lt;/tt&amp;gt;. &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; is required if and only if both &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PSI&amp;lt;/tt&amp;gt; are provided as Choi matrices and the input and output dimensions are different.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Perfectly distinguishable channels===&lt;br /&gt;
The following code demonstrates that the simple example of two channels that can be perfectly distinguished from &amp;lt;ref&amp;gt;John Watrous. [https://cs.uwaterloo.ca/~watrous/CS766/LectureNotes/20.pdf Lecture 20: Channel distinguishability and the completely bounded trace norm], &#039;&#039;Theory of Quantum Information Lecture Notes&#039;&#039;, 2011.&amp;lt;/ref&amp;gt; can indeed be perfectly distinguished:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; n = 4;&lt;br /&gt;
&amp;gt;&amp;gt; Phi = SymmetricProjection(n)*2/(n+1);&lt;br /&gt;
&amp;gt;&amp;gt; Psi = AntisymmetricProjection(n)*2/(n-1);&lt;br /&gt;
&amp;gt;&amp;gt; ChannelDistinguishability(Phi,Psi)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    1.0000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=ChannelDistinguishability}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
</feed>