<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Grover_for_two_qubits" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Grover for two qubits</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Grover_for_two_qubtis">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Grover_for_two_qubtis" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_Grover_for_two_qubtis" class="problems-wrapper" role="group"
aria-labelledby="Grover_for_two_qubtis-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Grover_for_two_qubtis" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@Grover_for_two_qubtis/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="3"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="Grover_for_two_qubtis-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Grover_for_two_qubtis-problem-progress" tabindex="-1">
Grover for two qubtis
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Grover_for_two_qubtis-problem-progress"></div>
<div class="problem">
<div>
<p>
Let us consider the task where we are supposed to find [mathjaxinline]M[/mathjaxinline] marked bit strings out of [mathjaxinline]N=2^ n[/mathjaxinline] possible strings in [mathjaxinline]\{ 0,1\} ^ n[/mathjaxinline]. We suppose [mathjaxinline]M[/mathjaxinline] is constant. Classically, it takes [mathjaxinline]\mathcal{O}(N/M)[/mathjaxinline] queries to find a marked string. Grover's algorithm allows one to accomplish this task with [mathjaxinline]\mathcal{O}(\sqrt{N/M})[/mathjaxinline], which is a quadratic speedup. In this problem, we set [mathjaxinline]M=1[/mathjaxinline]. </p>
<p>
The following figures show the circuit for the Grover's algorithm. [mathjaxinline]f[/mathjaxinline] for the oracle outputs [mathjaxinline]f(x) = 1[/mathjaxinline] if [mathjaxinline]x[/mathjaxinline] is a marked state and [mathjaxinline]f(x) = 0[/mathjaxinline] if it is not. Piecewise measurements over the [mathjaxinline]n[/mathjaxinline] qubits are made after some number of applications of [mathjaxinline]G[/mathjaxinline] and we declare that the measurement result is a marked state. The contents in [mathjaxinline]G[/mathjaxinline] is shown in the second figure. </p>
<div class="figure">
<center>
<img src="/assets/courseware/v1/2fa11bc79336dbe5c15259e658a7b97c/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3b_grover_circuit1.png" width="400" style="scale:0.6"/>
</center>
</div>
<div class="figure">
<center>
<img src="/assets/courseware/v1/c84f4352e2e5fa020fa8b9181113d8fc/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3b_grover_circuit2.png" width="400" style="scale:0.4"/>
</center>
</div>
<p>
In this problem, we consider [mathjaxinline]n=2[/mathjaxinline], [mathjaxinline]M=1[/mathjaxinline] case to follow what is going on. Let us suppose that 01 is a marked string out of four possible strings 00,01,10,11. The following figure shows the circuit for [mathjaxinline]G[/mathjaxinline] for [mathjaxinline]n=2[/mathjaxinline]. [mathjaxinline]|{-}\rangle[/mathjaxinline] is injected to the third input for the oracle. </p>
<div class="figure">
<center>
<img src="/assets/courseware/v1/fd283876d31a1090885c7cf49c0a87f2/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3b_grover_2bits.png" width="400" style="scale:0.4"/>
</center>
</div>
<ul class="itemize">
<li>
<p>
What is the state of two qubits after the first application of oracle? Answer using the ket notation. Choose the global phase so that the coefficients are real. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_Grover_for_two_qubtis_2_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Grover_for_two_qubtis_2_1" id="input_Grover_for_two_qubtis_2_1" aria-describedby="status_Grover_for_two_qubtis_2_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Grover_for_two_qubtis_2_1"/>
<span class="status unanswered" id="status_Grover_for_two_qubtis_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Grover_for_two_qubtis_2_1" class="answer"/>
<div id="display_Grover_for_two_qubtis_2_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Grover_for_two_qubtis_2_1_dynamath" name="input_Grover_for_two_qubtis_2_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
Find the probability of finding the marked string if we finish the algorithm by making the measurement after the first application of [mathjaxinline]G[/mathjaxinline]. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><div id="inputtype_Grover_for_two_qubtis_3_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Grover_for_two_qubtis_3_1" id="input_Grover_for_two_qubtis_3_1" aria-describedby="status_Grover_for_two_qubtis_3_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Grover_for_two_qubtis_3_1"/>
<span class="status unanswered" id="status_Grover_for_two_qubtis_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Grover_for_two_qubtis_3_1" class="answer"/>
<div id="display_Grover_for_two_qubtis_3_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Grover_for_two_qubtis_3_1_dynamath" name="input_Grover_for_two_qubtis_3_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
Find the probability of finding the marked string if we finish the algorithm by making the measurement after the second application of [mathjaxinline]G[/mathjaxinline]. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><div id="inputtype_Grover_for_two_qubtis_4_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Grover_for_two_qubtis_4_1" id="input_Grover_for_two_qubtis_4_1" aria-describedby="status_Grover_for_two_qubtis_4_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Grover_for_two_qubtis_4_1"/>
<span class="status unanswered" id="status_Grover_for_two_qubtis_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Grover_for_two_qubtis_4_1" class="answer"/>
<div id="display_Grover_for_two_qubtis_4_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Grover_for_two_qubtis_4_1_dynamath" name="input_Grover_for_two_qubtis_4_1_dynamath"/>
</div>
</div></div>
</p>
</li>
</ul>
<p>
<div class="solution-span">
<span id="solution_Grover_for_two_qubtis_solution_1"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Grover for two qubtis" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_Grover_for_two_qubtis" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_Grover_for_two_qubtis">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Grover_for_two_qubtis-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Grover_for_two_qubtis-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Grover_for_two_qubtis-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3x" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Quantum_search_by_continuous-time_simulation__1_of_4_" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Quantum search by continuous-time simulation (1 of 4)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_s14-wk4-gsearch" class="problems-wrapper" role="group"
aria-labelledby="s14-wk4-gsearch-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="s14-wk4-gsearch-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch-problem-progress" tabindex="-1">
Quantum search by continuous-time simulation
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch-problem-progress"></div>
<div class="problem">
<div>
<p>
Grover's quantum search algorithm can also be constructed as a continuous time quantum algorithm involving the simulation of a particular Hamiltonian. Consider the Hamiltonian </p>
<table id="a0000000005" class="equation" width="100%" cellspacing="0" cellpadding="7" style="table-layout:auto">
<tr>
<td class="equation" style="width:80%; border:none">[mathjax]H = |x\rangle \langle x|+|\psi \rangle \langle \psi | \, ,[/mathjax]</td>
<td class="eqnnum" style="width:20%; border:none;text-align:right">(1.3)</td>
</tr>
</table>
<p>
where [mathjaxinline]|\psi \rangle[/mathjaxinline] is the initial state of the system, and [mathjaxinline]|x\rangle[/mathjaxinline] is the solution state (with an unknown [mathjaxinline]x[/mathjaxinline]). Suppose you are given an oracle which you can call, which implements [mathjaxinline]U_ x(\Delta t) = \exp (-i |x\rangle \langle x| \Delta t)[/mathjaxinline] for a specified value of [mathjaxinline]\Delta t[/mathjaxinline] (your choice). Moreover, you also have available [mathjaxinline]U_{\psi }(\Delta t) = \exp (-i |\psi \rangle \langle \psi | \Delta t)[/mathjaxinline] (you can perform this yourself, since [mathjaxinline]|\psi \rangle[/mathjaxinline] is known). </p>
<p>
It is convenient in analyzing this problem to use the <a href="https://en.wikipedia.org/wiki/Bloch_sphere" target="_blank">Bloch vector representation</a>, [mathjaxinline]|x\rangle \langle x| = (I+Z)/2 =(I+\hat z \cdot \vec\sigma )/2[/mathjaxinline], with [mathjaxinline]\hat z \equiv (0,0,1)[/mathjaxinline] being the unit vector in the [mathjaxinline]z[/mathjaxinline] direction, and [mathjaxinline]|\psi \rangle \langle \psi | = (I+\vec\psi \cdot \vec\sigma )/2[/mathjaxinline]. Here, [mathjaxinline]\vec\sigma[/mathjaxinline] denotes a vector of Pauli matrices. </p>
<p>
Note that we may choose [mathjaxinline]\vec\psi = (\sin \phi , 0,\cos \phi )[/mathjaxinline], where [mathjaxinline]\sin \phi = 2\alpha \beta[/mathjaxinline], and [mathjaxinline]\cos \phi = (\alpha ^2-\beta ^2)[/mathjaxinline], by recognizing that [mathjaxinline]H[/mathjaxinline] acts only in a two-dimensional space spanned by [mathjaxinline]|x\rangle[/mathjaxinline] and [mathjaxinline]|y\rangle = |\psi \rangle - \langle x|\psi \rangle |x\rangle[/mathjaxinline] (un-normalized). </p>
<p>
This is illustrated in this figure: </p>
<p>
<img src="/assets/courseware/v1/e3274dd9d6ddff5ac91de58fec5c295f/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-cont-time-search.png" width="600"/>
</p>
<p>
Use this Bloch vector representation to fill in the following formula for [mathjaxinline]U(\Delta t) = U_{\psi }(\Delta t)U_{x}(\Delta t)[/mathjaxinline], up to an irrelevant global phase: </p>
<span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_s14-wk4-gsearch_2_1" class="capa_inputtype">
<div class="drag_and_drop_problem_div" id="drag_and_drop_div_s14-wk4-gsearch_2_1" data-plain-id="s14-wk4-gsearch_2_1">
</div>
<div class="drag_and_drop_problem_json" id="drag_and_drop_json_s14-wk4-gsearch_2_1" style="display:none;">{"targets": [{"w": "161", "id": "1", "y": "11", "h": "82", "x": "226"}, {"w": "160", "id": "2", "y": "11", "h": "82", "x": "451"}, {"w": "161", "id": "3", "y": "146", "h": "83", "x": "251"}, {"w": "160", "id": "4", "y": "146", "h": "83", "x": "470"}, {"w": "160", "id": "5", "y": "282", "h": "83", "x": "323"}], "draggables": [{"id": "cdt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/a58e02aa57d10e03c1276dc1acc56b4e/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover1_wk4-grover1_dnd_label1.png"}, {"id": "sdt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/8e493b8609496bfa27f44609f7822bcf/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover1_wk4-grover1_dnd_label2.png"}, {"id": "c2dt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/c35b6932eea1884a0c5274fbe465cb62/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover1_wk4-grover1_dnd_label3.png"}, {"id": "s2dt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/845b309ff874ef42aa6bc1a312b9961d/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover1_wk4-grover1_dnd_label4.png"}], "one_per_target": "true", "label_bg_color": "rgb(222, 139, 238)", "base_image": "/assets/courseware/v1/f9b81599f9e86f10fa2adbc1ff7d510a/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover1_wk4-grover1_dnd.png", "target_outline": "false"}</div>
<div class="script_placeholder" data-src="/static/js/capa/drag_and_drop.a31124208b9b.js"/>
<div class="unanswered" id="status_s14-wk4-gsearch_2_1">
<input type="text" name="input_s14-wk4-gsearch_2_1" id="input_s14-wk4-gsearch_2_1" aria-describedby="answer_s14-wk4-gsearch_2_1" value="" style="display:none;"/>
<p class="indicator-container drag-and-drop--status" aria-describedby="input_s14-wk4-gsearch_2_1">
<span class="status unanswered" id="status_s14-wk4-gsearch_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</p>
<p id="answer_s14-wk4-gsearch_2_1" class="answer"/>
</div>
</div></div>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch_solution_1"/>
</div></span>
<p>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch_solution_2"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Quantum search by continuous-time simulation" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_s14-wk4-gsearch" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_s14-wk4-gsearch">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1xxxx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1xxxx" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Quantum_search_by_continuous-time_simulation__2_of_4_" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Quantum search by continuous-time simulation (2 of 4)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch2">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch2" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_s14-wk4-gsearch2" class="problems-wrapper" role="group"
aria-labelledby="s14-wk4-gsearch2-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch2" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch2/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="s14-wk4-gsearch2-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch2-problem-progress" tabindex="-1">
Quantum search by continuous-time simulation II
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch2-problem-progress"></div>
<div class="problem">
<div>
<p>
The operation [mathjaxinline]U(\Delta t)[/mathjaxinline] can be interpreted as a rotation about an axis of rotation [mathjaxinline]\vec{r}[/mathjaxinline], through an angle [mathjaxinline]\theta[/mathjaxinline]. </p>
<p>
Let [mathjaxinline]N[/mathjaxinline] be the size of the problem (the number of possible solutions marked by the Grover oracle). </p>
<p>
Complete the following expressions for [mathjaxinline]\vec{r}[/mathjaxinline] and angle [mathjaxinline]\theta[/mathjaxinline]: </p>
<span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_s14-wk4-gsearch2_2_1" class="capa_inputtype">
<div class="drag_and_drop_problem_div" id="drag_and_drop_div_s14-wk4-gsearch2_2_1" data-plain-id="s14-wk4-gsearch2_2_1">
</div>
<div class="drag_and_drop_problem_json" id="drag_and_drop_json_s14-wk4-gsearch2_2_1" style="display:none;">{"targets": [{"w": "171", "id": "1", "y": "1", "h": "88", "x": "129"}, {"w": "171", "id": "2", "y": "1", "h": "88", "x": "465"}, {"w": "172", "id": "3", "y": "128", "h": "88", "x": "337"}, {"w": "172", "id": "4", "y": "250", "h": "88", "x": "337"}], "draggables": [{"id": "one", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/5be0d89d46ef512b7f7c8d34cf5694e2/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label1.png"}, {"id": "two", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/3f3a789cecaaf57bc0ffc18972a4c2d7/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label2.png"}, {"id": "sN", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/3f589288bcb31d18cbc380716bb60615/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label3.png"}, {"id": "N", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/ceb1b1a6454526597057226cb3b49032/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label4.png"}, {"id": "N2", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/d379b4864f84b1faa4d88ae4c6573155/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label5.png"}, {"id": "cdt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/9ba57da6300cecc6a222fea75b63e35e/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label6.png"}, {"id": "sdt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/68d009f964fbec21b71852a8925ab990/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label7.png"}, {"id": "c2dt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/93a08f43ff31c86aba38d6d579313087/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label8.png"}, {"id": "tc2dt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/275928b2b96f3718ae9b90060f39724d/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label9.png"}, {"id": "s2dt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/329ec8152dc3e3ca9c2d06a81c5b7972/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label10.png"}, {"id": "ts2dt", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/e4b1ac4fc7f4c5c8c53cb4a4e323977f/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd_label11.png"}], "one_per_target": "true", "label_bg_color": "rgb(222, 139, 238)", "base_image": "/assets/courseware/v1/afd1aeff897fe15e8c317218ff35841a/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-rth_wk4-grover-rth_dnd.png", "target_outline": "false"}</div>
<div class="script_placeholder" data-src="/static/js/capa/drag_and_drop.a31124208b9b.js"/>
<div class="unanswered" id="status_s14-wk4-gsearch2_2_1">
<input type="text" name="input_s14-wk4-gsearch2_2_1" id="input_s14-wk4-gsearch2_2_1" aria-describedby="answer_s14-wk4-gsearch2_2_1" value="" style="display:none;"/>
<p class="indicator-container drag-and-drop--status" aria-describedby="input_s14-wk4-gsearch2_2_1">
<span class="status unanswered" id="status_s14-wk4-gsearch2_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</p>
<p id="answer_s14-wk4-gsearch2_2_1" class="answer"/>
</div>
</div></div>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch2_solution_1"/>
</div></span>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Quantum search by continuous-time simulation II" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_s14-wk4-gsearch2" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_s14-wk4-gsearch2">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch2-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch2-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch2-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box2xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box2xx" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Quantum_search_by_continuous-time_simulation__3_of_4_" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Quantum search by continuous-time simulation (3 of 4)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch3">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch3" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_s14-wk4-gsearch3" class="problems-wrapper" role="group"
aria-labelledby="s14-wk4-gsearch3-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch3" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch3/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="2"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="s14-wk4-gsearch3-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch3-problem-progress" tabindex="-1">
Quantum search by continuous-time simulation III
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch3-problem-progress"></div>
<div class="problem">
<div>
<p>
Give the smallest value for the time interval [mathjaxinline]\Delta t[/mathjaxinline] such that the operations [mathjaxinline]U_{\psi }[/mathjaxinline] and [mathjaxinline]U_ x[/mathjaxinline] are identical to the operations used in the quantum circuit model realization of the quantum simulation algorithm. </p>
<p>
Also fill in the correct expressions for the two operations; </p>
<p>
<p style="display:inline">[mathjaxinline]\Delta t =[/mathjaxinline]</p>
<div class="inline" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_s14-wk4-gsearch3_2_1" class=" capa_inputtype inline textline">
<div class="unanswered inline">
<input type="text" name="input_s14-wk4-gsearch3_2_1" id="input_s14-wk4-gsearch3_2_1" aria-describedby="status_s14-wk4-gsearch3_2_1" value=""/>
<span class="trailing_text" id="trailing_text_s14-wk4-gsearch3_2_1"/>
<span class="status unanswered" id="status_s14-wk4-gsearch3_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_s14-wk4-gsearch3_2_1" class="answer"/>
</div>
</div></div>
</p>
<span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><div id="inputtype_s14-wk4-gsearch3_3_1" class="capa_inputtype">
<div class="drag_and_drop_problem_div" id="drag_and_drop_div_s14-wk4-gsearch3_3_1" data-plain-id="s14-wk4-gsearch3_3_1">
</div>
<div class="drag_and_drop_problem_json" id="drag_and_drop_json_s14-wk4-gsearch3_3_1" style="display:none;">{"targets": [{"w": "108", "id": "1", "y": "1", "h": "101", "x": "262"}, {"w": "107", "id": "3", "y": "1", "h": "101", "x": "398"}, {"w": "108", "id": "2", "y": "1", "h": "101", "x": "533"}, {"w": "108", "id": "4", "y": "147", "h": "101", "x": "262"}, {"w": "107", "id": "5", "y": "147", "h": "101", "x": "398"}, {"w": "108", "id": "6", "y": "147", "h": "101", "x": "533"}], "draggables": [{"id": "I", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/fc742ec934b252faf01f7c558ac24444/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd_label1.png"}, {"id": "one", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/efd552cb7059079f0b257b6abe61feac/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd_label2.png"}, {"id": "eye", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/b722d35403ea7a359e94b0abd0342200/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd_label3.png"}, {"id": "two", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/efff55319c766670d10d0863e3e69158/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd_label4.png"}, {"id": "plus", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/65e25ba701d57871be2d3270d2019da7/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd_label5.png"}, {"id": "minus", "can_reuse": "true", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/4895ba2f572eab63c1728b2b273d21d6/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd_label6.png"}], "one_per_target": "true", "label_bg_color": "rgb(222, 139, 238)", "base_image": "/assets/courseware/v1/f3be23cbbac7dbd414f62690986bb74e/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover2_wk4-grover2_dnd.png", "target_outline": "false"}</div>
<div class="script_placeholder" data-src="/static/js/capa/drag_and_drop.a31124208b9b.js"/>
<div class="unanswered" id="status_s14-wk4-gsearch3_3_1">
<input type="text" name="input_s14-wk4-gsearch3_3_1" id="input_s14-wk4-gsearch3_3_1" aria-describedby="answer_s14-wk4-gsearch3_3_1" value="" style="display:none;"/>
<p class="indicator-container drag-and-drop--status" aria-describedby="input_s14-wk4-gsearch3_3_1">
<span class="status unanswered" id="status_s14-wk4-gsearch3_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</p>
<p id="answer_s14-wk4-gsearch3_3_1" class="answer"/>
</div>
</div></div>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch3_solution_1"/>
</div></span>
<p>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch3_solution_2"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Quantum search by continuous-time simulation III" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_s14-wk4-gsearch3" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_s14-wk4-gsearch3">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch3-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch3-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch3-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3xx" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Quantum_search_by_continuous-time_simulation__4_of_4_" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Quantum search by continuous-time simulation (4 of 4)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch4">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch4" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_s14-wk4-gsearch4" class="problems-wrapper" role="group"
aria-labelledby="s14-wk4-gsearch4-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch4" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch4/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="s14-wk4-gsearch4-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch4-problem-progress" tabindex="-1">
Quantum search by continuous-time simulation IV
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@s14-wk4-gsearch4-problem-progress"></div>
<div class="problem">
<div>
<p>
Unlike the usual quantum circuit version of Grover's algorithm, quantum search by continuous-time simulation can obtain the final state [mathjaxinline]|x\rangle[/mathjaxinline] <em>exactly</em>, meaning that the algorithm works with probability [mathjaxinline]1[/mathjaxinline], rather than with some smaller probability. </p>
<p>
This is done by choosing [mathjaxinline]\Delta t[/mathjaxinline] carefully. Let [mathjaxinline]K[/mathjaxinline] be the number of rotations made about the axis [mathjaxinline]\vec{r}[/mathjaxinline], each time by angle [mathjaxinline]\theta[/mathjaxinline]. [mathjaxinline]K[/mathjaxinline] is required to be of the order [mathjaxinline]\mathcal{O}(\sqrt{N})[/mathjaxinline]. Approximate the total rotation angle needed by the angle between [mathjaxinline]\hat{z}[/mathjaxinline] and [mathjaxinline]\vec{\psi }[/mathjaxinline], that is, [mathjaxinline]\cos ^{-1}( \hat{z}\cdot \vec{\psi })[/mathjaxinline]. </p>
<p>
Using [mathjaxinline]K[/mathjaxinline] and that approximation, complete this expression for the time step size [mathjaxinline]\Delta t[/mathjaxinline] to obtain the final state exactly: </p>
<span>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_s14-wk4-gsearch4_2_1" class="capa_inputtype">
<div class="drag_and_drop_problem_div" id="drag_and_drop_div_s14-wk4-gsearch4_2_1" data-plain-id="s14-wk4-gsearch4_2_1">
</div>
<div class="drag_and_drop_problem_json" id="drag_and_drop_json_s14-wk4-gsearch4_2_1" style="display:none;">{"targets": [{"w": "102", "id": "2", "y": "19", "h": "72", "x": "549"}, {"w": "102", "id": "3", "y": "114", "h": "72", "x": "549"}, {"w": "102", "id": "4", "y": "215", "h": "72", "x": "463"}], "draggables": [{"id": "one", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/cb51e77dcfa7d57c24a909f33d057b55/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label1.png"}, {"id": "two", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/7c213870995d4b82f5e189cca4d278bb/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label2.png"}, {"id": "SN", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/f0751c73d82fca958b19a28b4c6dee5e/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label3.png"}, {"id": "N", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/59284a34a8b0b0138391af28a28e8f72/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label4.png"}, {"id": "N2", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/4214140bf7eaf727d551f3823a350f33/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label5.png"}, {"id": "KN", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/65057113a2887ef59a63dc0f1acb9108/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label6.png"}, {"id": "K", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/373687501af7575d8cb1ccea9c6c07da/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label7.png"}, {"id": "TK", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/44bb3091e838066a61d59f48b7954a6e/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label8.png"}, {"id": "KsN", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/fdb9682c040521cd9042d20455dd848d/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label9.png"}, {"id": "NsK", "can_reuse": "", "label": "", "target_fields": [], "icon": "/assets/courseware/v1/a6ed793661abbe9e5645ca79c7763658/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd_label10.png"}], "one_per_target": "true", "label_bg_color": "rgb(222, 139, 238)", "base_image": "/assets/courseware/v1/7c4aed36839a18c8c76b8305713dfbda/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_wk4-grover-exact2b_wk4-grover-exact2b_dnd.png", "target_outline": "false"}</div>
<div class="script_placeholder" data-src="/static/js/capa/drag_and_drop.a31124208b9b.js"/>
<div class="unanswered" id="status_s14-wk4-gsearch4_2_1">
<input type="text" name="input_s14-wk4-gsearch4_2_1" id="input_s14-wk4-gsearch4_2_1" aria-describedby="answer_s14-wk4-gsearch4_2_1" value="" style="display:none;"/>
<p class="indicator-container drag-and-drop--status" aria-describedby="input_s14-wk4-gsearch4_2_1">
<span class="status unanswered" id="status_s14-wk4-gsearch4_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</p>
<p id="answer_s14-wk4-gsearch4_2_1" class="answer"/>
</div>
</div></div>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch4_solution_1"/>
</div></span>
<p>
<div class="solution-span">
<span id="solution_s14-wk4-gsearch4_solution_2"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Quantum search by continuous-time simulation IV" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_s14-wk4-gsearch4" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_s14-wk4-gsearch4">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch4-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch4-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="s14-wk4-gsearch4-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@site_search_box030197">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@site_search_box030197" data-request-token="e2c78d361edb11f097b212192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
© All Rights Reserved