&quot;&quot;&quot;</span>
<span class="sd">        Constructor</span>

<span class="sd">        Do in constructor as much hamil indep stuff as possible so don&#39;t</span>
<span class="sd">        have to redo it with every call to cost fun. Also,</span>
<span class="sd">        when self.num_samples !=0,  we store a dict called term_to_exec</span>
<span class="sd">        mapping an executable (output of Rigetti compile() function) to a</span>
<span class="sd">        term,  for each term in the hamiltonia