def iplot_state_hinton(rho, figsize=None):
<EOL>html_template = Template("""<STR_LIT>""")<EOL>javascript_template = Template("""<STR_LIT>""")<EOL>rho = _validate_input_state(rho)<EOL>if figsize is None:<EOL><INDENT>options = {}<EOL><DEDENT>else:<EOL><INDENT>options = {'<STR_LIT:width>': figsize[<NUM_LIT:0>], '<STR_LIT>': figsize[<NUM_LIT:1>]}<EOL><DEDENT>div_number = str(time.time())<EOL>div_number = re.sub('<STR_LIT>', '<STR_LIT>', div_number)<EOL>real = []<EOL>imag = []<EOL>for xvalue in rho:<EOL><INDENT>row_real = []<EOL>col_imag = []<EOL>for value_real in xvalue.real:<EOL><INDENT>row_real.append(float(value_real))<EOL><DEDENT>real.append(row_real)<EOL>for value_imag in xvalue.imag:<EOL><INDENT>col_imag.append(float(value_imag))<EOL><DEDENT>imag.append(col_imag)<EOL><DEDENT>html = html_template.substitute({<EOL>'<STR_LIT>': div_number<EOL>})<EOL>javascript = javascript_template.substitute({<EOL>'<STR_LIT>': div_number,<EOL>'<STR_LIT>': [{'<STR_LIT:data>': real}, {'<STR_LIT:data>': imag}],<EOL>'<STR_LIT>': options<EOL>})<EOL>display(HTML(html + javascript))<EOL>
Create a hinton representation.

        Graphical representation of the input array using a 2D city style
        graph (hinton).

        Args:
            rho (array): Density matrix
            figsize (tuple): Figure size in pixels.