\documentclass{standalone}

\usepackage{graphicx,bm,microtype,hyperref,algpseudocode,subfigure,algorithm,algorithmicx,multirow,footnote,xcolor,physics,lipsum,wasysym}

\definecolor{darkgreen}{RGB}{0, 180, 0}
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\purple}[1]{\textcolor{purple}{#1}}
\newcommand{\orange}[1]{\textcolor{orange}{#1}}
\newcommand{\green}[1]{\textcolor{darkgreen}{#1}}
\newcommand{\black}[1]{\textcolor{black}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\pub}[1]{\textcolor{purple}{#1}}
\newcommand{\violet}[1]{\textcolor{violet}{#1}}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes.geometric}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.pathreplacing}

\tikzset{snake it/.style={
decoration={snake, 
    amplitude = .4mm,
    segment length = 2mm},decorate}
}
    
\begin{document}

%%% FIGURE 1 %%%
\begin{tikzpicture}
	\begin{scope}[very thick,
		node distance=2.5cm,on grid,>=stealth',
		Operator/.style={circle,draw,fill=yellow!40},
		DeadOp/.style={circle,draw,fill=gray!40},
		Input/.style={fill=white!40},
		Output/.style={fill=white!40}]
		
		% model space
		\draw [blue] (0,3.3) -- (1.1,3.3) -- (1.1,2.2) -- (0,2.2) -- (0,3.3);
		\node [blue,thick]  (model) at (0.55,2.75) {$\boldsymbol{F}$};
		% perturbative space
		\draw [red] (0,3.3) -- (2.2,3.3) -- (2.2,1.1) -- (0,1.1) -- (0,3.3);
		\node [thick]  (model) at (1.65,1.65) {$\red{\boldsymbol{C}^{\text{2h1p}}}$};
		\node [thick]  (model) at (1.65,2.75) {$\red{\boldsymbol{W}^{\text{2h1p}}}$};
		\node [thick]  (model) at (0.55,1.65) {$\red{\boldsymbol{W}^{\text{2h1p}}}$};
		% FCI space
		\draw [orange] (0,3.3) -- (3.3,3.3) -- (3.3,0) -- (0,0);
		\draw [black]  (0,0) -- (0,3.3) -- (3.3,3.3);
		\node [thick]  (model) at (2.75,0.55) {$\orange{\boldsymbol{C}^{\text{2p1h}}}$};
		\node [thick]  (model) at (2.75,2.75) {$\orange{\boldsymbol{W}^{\text{2p1h}}}$};
		\node [thick]  (model) at (0.55,0.55) {$\orange{\boldsymbol{W}^{\text{2p1h}}}$};
		\node [thick]  (model) at (2.75,1.65) {$\black{\boldsymbol{0}}$};
		\node [thick]  (model) at (1.65,0.55) {$\black{\boldsymbol{0}}$};
		\draw[step=1.1,black,thin] (0,0) grid (3.3,3.3);

		\draw [decorate,decoration={brace,amplitude=3pt},xshift=3pt,yshift=0]
		(3.3,3.3) -- (3.3,2.2) node [black,midway,xshift=1.3cm] {\footnotesize internal space $\boldsymbol{P}$};

		\draw [decorate,decoration={brace,mirror,amplitude=3pt},xshift=-3pt,yshift=0]
		(0,3.3) -- (0,2.2) node [blue,midway,xshift=-1.3cm] {\footnotesize \blue{1h \& 1p conf.}};

		\draw [decorate,decoration={brace,mirror,amplitude=3pt},xshift=-3pt,yshift=0]
		(0,2.2) -- (0,1.1) node [black,midway,xshift=-1.3cm] {\footnotesize \red{2h1p conf.}};

		\draw [decorate,decoration={brace,mirror,amplitude=3pt},xshift=-3pt,yshift=0]
		(0,1.1) -- (0,0) node [black,midway,xshift=-1.3cm] {\footnotesize \orange{2p1h conf.}};

		\draw [decorate,decoration={brace,amplitude=3pt},xshift=3pt,yshift=0pt]
		(3.3,2.2) -- (3.3,0) node [black,midway,xshift=1.3cm] {\footnotesize external space $\boldsymbol{Q}$};

%		\draw [decorate,decoration={brace,mirror,amplitude=3pt},xshift=0pt,yshift=-3pt]
%		(0,0) -- (3,0) node [black,midway,yshift=-0.3cm] {\footnotesize FCI space};

	\end{scope}
\end{tikzpicture}
%%% 	%%%

\end{document}
